I'm trying to create a tablayout with icons. I used the property setIcon
but one of the icon looked a bit smaller than the rest so I decided to use custom view to display that icon. The problem is that it's a little blurred. If I use an icon with larger resolution, then the size of the icon changes to but I want to keep the size of the icon the same as the other icons.
Here's the layout for 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 I set the view to the 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 is as below (second icon from the right):
I also need to push it down a little to align it with other icons.
If I use 'setIcon', the result is this:
As you can see from the image, the icon looks a bit smaller. How do I fix this?