android - tablayout custom view - changing icon size -


i'm trying create tablayout icons. used property seticon 1 of icon looked bit smaller rest decided use custom view display icon. problem it's little blurred. if use icon larger resolution, size of icon changes want keep size of icon same other icons.

here's layout custom view:

<imageview xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_gravity="center"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:id="@+id/icon"     android:layout_centerhorizontal="true" /> 

and here's how set view icon:

textview tabone = (textview)layoutinflater.from(this).inflate(resource.layout.custom_tab, null); tabone.setcompounddrawableswithintrinsicbounds(0, resource.drawable.ic_newnotif, 0, 0); tablayout.gettabat(3).setcustomview(tabone); 

the result below (second icon right):

enter image description here

i need push down little align other icons.

if use 'seticon', result this:

enter image description here

as can see image, icon looks bit smaller. how fix this?

you can try our answer although didn't try issue of your's long issue height can solved ans post here if didn't work let me know try other


Comments