Android --- TabLayout 每一个选项卡前面加图标
生活随笔
收集整理的這篇文章主要介紹了
Android --- TabLayout 每一个选项卡前面加图标
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
上一張效果圖,簡(jiǎn)單明了
直接上代碼,圖片自己替換
ActivityFragment.java
所對(duì)應(yīng)的 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>以上部分源碼借鑒度娘,記不清博主是誰(shuí)了,如有侵權(quán),請(qǐng)轉(zhuǎn)告我鏈接地址
總結(jié)
以上是生活随笔為你收集整理的Android --- TabLayout 每一个选项卡前面加图标的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android --- Dialog 中
- 下一篇: Android --- 微信支付时出现错