Last active
September 28, 2016 16:22
-
-
Save matsuyoro/e6389db2adfa86d07f1b0f11b976c505 to your computer and use it in GitHub Desktop.
fragmentのタブのアイコン画像のサイズをカスタマイズする ref: http://qiita.com/matsuyoro/items/48399411cca6764e051b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="48dp" | |
android:layout_height="48dp" | |
android:scaleType="centerInside" | |
app:srcCompat="@drawable/ic_attachment_black_24dp" | |
android:tint="@color/colorBlack" | |
/> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="32dp" | |
android:layout_height="32dp" | |
android:scaleType="centerInside" | |
android:src="@drawable/image_icon_line" | |
/> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); | |
tabLayout.setupWithViewPager(mViewPager); | |
tabLayout.getTabAt(0).setCustomView(R.layout.design_fragment_icon_camera); | |
tabLayout.getTabAt(1).setCustomView(R.layout.design_fragment_line_weight); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment