Open mladenbabic opened 6 years ago
@vutrannguyen Yes, but it is too much customized for my project and it won't be helpful for you.
Thanks for the reply @mladenbabic . I solved that problem like this:
Toolbar headerMain = view.findViewById(R.id.headerMain);
SearchInputView searchBar = headerMain.findViewById(R.id.search_bar_text);
ImageView imageView = new ImageView(getContext());
imageView.setImageResource(R.drawable.logo);
FrameLayout frameLayout = headerMain.findViewById(R.id.search_input_parent);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
layoutParams.setMargins(-80,15,0,15);
layoutParams.addRule(RelativeLayout.BELOW, R.id.search_input_parent);
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
frameLayout.addView(imageView, layoutParams);
@mladenbabic Have you solved this problem yet? Looking forward to sharing