Android --- TabLayout 每一个选项卡前面加图标
生活随笔
收集整理的這篇文章主要介紹了
Android --- TabLayout 每一个选项卡前面加图标
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
上一張效果圖,簡單明了
直接上代碼,圖片自己替換
ActivityFragment.java
所對應的 xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context="com.gxuwz.yixin.activity.MainActivity"><com.google.android.material.tabs.TabLayoutandroid:id="@+id/tab"android:layout_height="wrap_content"android:layout_width="match_parent"android:layout_gravity="left" ></com.google.android.material.tabs.TabLayout> </RelativeLayout>以上部分源碼借鑒度娘,記不清博主是誰了,如有侵權,請轉告我鏈接地址
總結
以上是生活随笔為你收集整理的Android --- TabLayout 每一个选项卡前面加图标的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android --- Dialog 中
- 下一篇: android sina oauth2.