最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

修改Android FloatingActionButton的title的文字顏色及背景顏色實(shí)例詳解

 更新時(shí)間:2017年03月02日 15:02:53   作者:天才哆啦夢(mèng)  
這篇文章主要介紹了修改Android FloatingActionButton的title的文字顏色及背景顏色實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下

修改Android FloatingActionButton的title的文字顏色及背景顏色實(shí)例詳解

首先看一張圖片

這里寫(xiě)圖片描述

我是在一個(gè)不錯(cuò)的開(kāi)源的FloatingActionButton庫(kù)基礎(chǔ)上實(shí)現(xiàn)的,鏈接github開(kāi)源庫(kù) 參考圖片的標(biāo)記和代碼里的注釋。代碼如下:

<com.getbase.floatingactionbutton.FloatingActionsMenu
      android:id="@+id/fab_meau"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:layout_alignParentEnd="true"
      fab:fab_addButtonColorNormal="@color/theme_color" //修改meau按鈕的背景色
      fab:fab_addButtonColorPressed="@color/fab_pressed_color" //meau按鈕按下的顏色
      fab:fab_addButtonPlusIconColor="@color/white" //meau中間 "+" 的顏色
      fab:fab_labelStyle="@style/fab_labels_style" //title樣式,可以修改title的顏色和背景
      android:layout_marginBottom="16dp"
      android:layout_marginRight="16dp"
      android:layout_marginEnd="16dp">

      <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_action_a"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/white"
        fab:fab_title="聯(lián)系客服發(fā)布信息" //button的標(biāo)題
        fab:fab_size="mini" //normal和mini兩個(gè)值,normal和meau一樣大
        />

      <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_action_b"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/white"
        fab:fab_title="個(gè)人發(fā)布信息"
        fab:fab_size="mini" 
        fab:fab_colorPressed="@color/fab_pressed_color"
        />

    </com.getbase.floatingactionbutton.FloatingActionsMenu>

在value.xml配置樣式fab_labels_style代碼如下:

<style name="fab_labels_style">
    <item name="android:background">@drawable/fab_label_background</item> //文字背景的樣式
    <item name="android:textColor">@color/black</item> //文字的顏色
  </style>

drawable文件夾下的fab_label_background.xml代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
  <solid android:color="@color/white"/>
  <padding
    android:left="16dp"
    android:top="4dp"
    android:right="16dp"
    android:bottom="4dp"/> //離內(nèi)邊框的距離
  <corners
    android:radius="5dp"/> //邊框四個(gè)叫的弧度

  <stroke
    android:width="1dp"
    android:color="@color/text_color_84"/> //邊框邊線的寬度和顏色
</shape>

搜了網(wǎng)上修改FloatingActionButton的title顏色,結(jié)果沒(méi)有搜到,解決了問(wèn)題后總結(jié)一下。

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

  • 解決PhoneGap不支持viewport的幾種方法

    解決PhoneGap不支持viewport的幾種方法

    今天小編就為大家分享一篇關(guān)于解決PhoneGap不支持viewport的幾種方法,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧
    2018-12-12
  • Android如何獲取子View的位置及坐標(biāo)詳解

    Android如何獲取子View的位置及坐標(biāo)詳解

    這篇文章主要給大家介紹了關(guān)于Android如何獲取子View的位置及坐標(biāo)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-10-10
  • Android自定義View用切圖顯示字符串

    Android自定義View用切圖顯示字符串

    這篇文章主要為大家詳細(xì)介紹了Android自定義View用切圖顯示字符串,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-01-01
  • Android?registerForActivityResult新用法實(shí)現(xiàn)兩個(gè)Activity間數(shù)據(jù)傳遞

    Android?registerForActivityResult新用法實(shí)現(xiàn)兩個(gè)Activity間數(shù)據(jù)傳遞

    這篇文章主要為大家介紹了Android?registerForActivityResult新用法實(shí)現(xiàn)兩個(gè)Activity間數(shù)據(jù)傳遞詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-04-04
  • Android WebView如何判定網(wǎng)頁(yè)加載的錯(cuò)誤

    Android WebView如何判定網(wǎng)頁(yè)加載的錯(cuò)誤

    這篇文章主要介紹了Android WebView如何判定網(wǎng)頁(yè)加載的錯(cuò)誤,幫助大家更好的理解和學(xué)習(xí)使用Android,感興趣的朋友可以了解下
    2021-04-04
  • Android實(shí)現(xiàn)音樂(lè)視頻播放

    Android實(shí)現(xiàn)音樂(lè)視頻播放

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)音樂(lè)視頻播放,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-05-05
  • Android繪制雙折線圖的方法

    Android繪制雙折線圖的方法

    這篇文章主要為大家詳細(xì)介紹了Android繪制雙折線圖的方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-02-02
  • Android studio報(bào): java.lang.ExceptionInInitializerError 錯(cuò)誤

    Android studio報(bào): java.lang.ExceptionInInitializerError 錯(cuò)誤

    本篇文章主要介紹了Android studio報(bào): java.lang.ExceptionInInitializerError錯(cuò)誤的解決方法,具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧
    2017-03-03
  • Android編程自定義菜單實(shí)現(xiàn)方法詳解

    Android編程自定義菜單實(shí)現(xiàn)方法詳解

    這篇文章主要介紹了Android編程自定義菜單實(shí)現(xiàn)方法,結(jié)合實(shí)例形式分析了Android自定義菜單的布局、動(dòng)畫(huà)及功能相關(guān)實(shí)現(xiàn)技巧與注意事項(xiàng),需要的朋友可以參考下
    2017-02-02
  • Android 應(yīng)用適配 Android 7.0 權(quán)限要求詳解

    Android 應(yīng)用適配 Android 7.0 權(quán)限要求詳解

    今天小編就為大家分享一篇Android 應(yīng)用適配 Android 7.0 權(quán)限要求詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-08-08

最新評(píng)論

云浮市| 亳州市| 巩留县| 渝中区| 囊谦县| 上饶县| 淳化县| 高雄县| 延津县| 孟津县| 蕲春县| 嵊泗县| 达孜县| 江达县| 南江县| 合作市| 喜德县| 浏阳市| 常山县| 和平县| 灌云县| 堆龙德庆县| 林周县| 德州市| 平凉市| 遵义县| 遵化市| 元阳县| 兰西县| 舞阳县| 会宁县| 五大连池市| 合阳县| 江永县| 重庆市| 福泉市| 延安市| 克东县| 台安县| 东乌珠穆沁旗| 洛川县|