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

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

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

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

首先看一張圖片

這里寫圖片描述

我是在一個不錯的開源的FloatingActionButton庫基礎(chǔ)上實現(xiàn)的,鏈接github開源庫 參考圖片的標(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兩個值,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="個人發(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"/> //邊框四個叫的弧度

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

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

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

相關(guān)文章

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

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

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

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

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

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

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

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

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

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

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

    Android實現(xiàn)音樂視頻播放

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

    Android繪制雙折線圖的方法

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

    Android studio報: java.lang.ExceptionInInitializerError 錯誤

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

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

    這篇文章主要介紹了Android編程自定義菜單實現(xiàn)方法,結(jié)合實例形式分析了Android自定義菜單的布局、動畫及功能相關(guān)實現(xiàn)技巧與注意事項,需要的朋友可以參考下
    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)限要求詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-08-08

最新評論

望奎县| 武山县| 双流县| 白河县| 古浪县| 嵊州市| 津南区| 雷州市| 甘孜| 祁东县| 墨江| 巩义市| 海晏县| 莱西市| 肃南| 淮北市| 潮州市| 和田县| 河津市| 曲阜市| 石柱| 繁峙县| 饶河县| 当涂县| 平邑县| 饶平县| 神农架林区| 澄江县| 布尔津县| 安阳市| 上高县| 沅江市| 平南县| 那坡县| 日照市| 昌乐县| 集安市| 武邑县| 临夏市| 青河县| 和平县|