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

Android下修改SeekBar樣式的解決辦法

 更新時(shí)間:2013年06月15日 10:53:39   作者:  
本篇文章是對(duì)在Android下修改SeekBar樣式的解決辦法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
SeekBar配置文件:
Xml代碼
復(fù)制代碼 代碼如下:

<SeekBar    
         android:id="@+id/player_seekbar"   
         android:layout_width="245px"   
         android:layout_height="25px"   
         android:progressDrawable="@drawable/seekbar_style"   
         android:thumb="@drawable/thumb"   
         android:paddingLeft="16px"   
         android:paddingRight="15px"   
         android:paddingTop="5px"   
         android:paddingBottom="5px"   
         android:progress="0"   
         android:max="0"   
         android:secondaryProgress="0"   
         />   

android:progressDrawable="@drawable/seekbar_style"背景條
seekbar_style配置如下:
Xml代碼
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="UTF-8"?>   

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">   

     <item android:id="@android:id/background">   
         <shape>   
             <corners android:radius="5dip" />   
             <gradient   
                     android:startColor="#ff9d9e9d"   
                     android:centerColor="#ff5a5d5a"   
                     android:centerY="0.75"   
                     android:endColor="#ff747674"   
                     android:angle="270"   
             />   
         </shape>   
     </item>   

     <item android:id="@android:id/secondaryProgress">   
         <clip>   
             <shape>   
                 <corners android:radius="5dip" />   
                 <gradient   
                         android:startColor="#80ffd300"   
                         android:centerColor="#80ffb600"   
                         android:centerY="0.75"   
                         android:endColor="#a0ffcb00"   
                         android:angle="270"   
                 />   
             </shape>   
         </clip>   
     </item>   

     <item android:id="@android:id/progress">   
         <clip>   
             <shape>   
                 <corners android:radius="5dip" />   
                 <gradient   
                         android:startColor="#ff0099CC"   
                         android:centerColor="#ff3399CC"   
                         android:centerY="0.75"   
                         android:endColor="#ff6699CC"   
                         android:angle="270"   
                 />   
             </shape>   
         </clip>   
     </item>   

</layer-list>   

或者:用圖片如下:
Xml代碼
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>   
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">   

    <item android:id="@android:id/background"    
          android:drawable="@drawable/progress_bg" />   

    <item android:id="@android:id/secondaryProgress"   
          android:drawable="@drawable/second_progress">   
    </item>       

    <item android:id="@android:id/progress"   
          android:drawable="@drawable/first_progress">   

    </item>    
</layer-list>   

方形
Xml代碼
復(fù)制代碼 代碼如下:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">    
    <item android:id="@android:id/background"    
    android:drawable="@drawable/progress_bg" />    
    <item android:id="@android:id/secondaryProgress">    
     <clip android:drawable="@drawable/second_progress" />    
    </item>    
    <item android:id="@android:id/progress">    
         <clip android:drawable="@drawable/first_progress" />    
    </item>    
</layer-list>   

android:thumb="@drawable/thumb"就是那個(gè)會(huì)動(dòng)的球
配置如下:
Xml代碼
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="UTF-8"?>   
<selector xmlns:android="http://schemas.android.com/apk/res/android">         

    <!-- 按下狀態(tài)-->   
    <item    
        android:state_focused="true"    
        android:state_pressed="true"    
        android:drawable="@drawable/thumb_pressed" />         
    <!-- 普通無焦點(diǎn)狀態(tài) -->   
    <item    
        android:state_focused="false"    
        android:state_pressed="false"   
        android:drawable="@drawable/thumb_normal" />               
    <!-- 有焦點(diǎn)狀態(tài)-->   
    <item    
        android:state_focused="true"    
        android:state_pressed="false"               
        android:drawable="@drawable/thumb_focused" />          
    <!-- 有焦點(diǎn) -->   
    <item    
        android:state_focused="true"               
        android:drawable="@drawable/thumb_focused" />      
</selector> 

相關(guān)文章

  • 源碼詳解Android中View.post()用法

    源碼詳解Android中View.post()用法

    本文通過源碼給大家詳細(xì)分析了在Android中View.post()的用法以及經(jīng)常遇到的問題和解決辦法,一起來學(xué)習(xí)下。
    2017-12-12
  • Android IPC機(jī)制利用Messenger實(shí)現(xiàn)跨進(jìn)程通信

    Android IPC機(jī)制利用Messenger實(shí)現(xiàn)跨進(jìn)程通信

    這篇文章主要介紹了Android IPC機(jī)制中 Messager 實(shí)現(xiàn)跨進(jìn)程通信的知識(shí),對(duì)Android學(xué)習(xí)通信知識(shí)非常重要,需要的同學(xué)可以參考下
    2016-07-07
  • Android?ContentObserver?監(jiān)聽短信思路詳解

    Android?ContentObserver?監(jiān)聽短信思路詳解

    ContentObserver允許在Android中監(jiān)控特定數(shù)據(jù)的變化,可用于短信等應(yīng)用的數(shù)據(jù)監(jiān)聽,開發(fā)者可通過繼承ContentObserver并實(shí)現(xiàn)onChange方法來定義當(dāng)目標(biāo)內(nèi)容變化時(shí)的響應(yīng)行為,感興趣的朋友一起看看吧
    2024-09-09
  • 如何使用Flutter實(shí)現(xiàn)58同城中的加載動(dòng)畫詳解

    如何使用Flutter實(shí)現(xiàn)58同城中的加載動(dòng)畫詳解

    這篇文章主要給大家介紹了關(guān)于如何使用Flutter實(shí)現(xiàn)58同城中加載動(dòng)畫詳?shù)南嚓P(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Flutter具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • Android打開圖庫(kù)選擇照片功能代碼

    Android打開圖庫(kù)選擇照片功能代碼

    這篇文章主要介紹了Android打開圖庫(kù)選擇照片功能代碼以及實(shí)現(xiàn)流程分析,對(duì)此有需要的朋友參考學(xué)習(xí)下吧。
    2018-02-02
  • AndroidStudio項(xiàng)目制作倒計(jì)時(shí)模塊的方法

    AndroidStudio項(xiàng)目制作倒計(jì)時(shí)模塊的方法

    本篇文章主要介紹了AndroidStudio項(xiàng)目制作倒計(jì)時(shí)模塊的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • 在Android中訪問WebService接口的方法

    在Android中訪問WebService接口的方法

      最近公司有個(gè)項(xiàng)目需要從Android平臺(tái)訪問WebService接口,實(shí)現(xiàn)向發(fā)布的函數(shù)傳遞對(duì)象。在網(wǎng)上找了一些資料,發(fā)現(xiàn)使用ksoap2可以調(diào)用WebService傳遞對(duì)象。
    2013-05-05
  • Android錄制聲音文件(音頻)并播放

    Android錄制聲音文件(音頻)并播放

    這篇文章主要為大家詳細(xì)介紹了Android錄制聲音文件并播放音頻文件功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-11-11
  • android實(shí)現(xiàn)九宮格程序

    android實(shí)現(xiàn)九宮格程序

    這篇文章主要為大家詳細(xì)介紹了android實(shí)現(xiàn)九宮格程序,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-06-06
  • 札記:android手勢(shì)識(shí)別功能實(shí)現(xiàn)(利用MotionEvent)

    札記:android手勢(shì)識(shí)別功能實(shí)現(xiàn)(利用MotionEvent)

    現(xiàn)在手勢(shì)識(shí)別的應(yīng)用已經(jīng)很廣泛了。本篇文章主要介紹了android手勢(shì)識(shí)別功能實(shí)現(xiàn),具有一定的參考價(jià)值,有興趣的可以了解一下。
    2016-11-11

最新評(píng)論

进贤县| 秦皇岛市| 漾濞| 江西省| 江安县| 绩溪县| 法库县| 吉木乃县| 泽普县| 比如县| 田东县| 沁水县| 山阳县| 龙江县| 武隆县| 如皋市| 腾冲县| 巨鹿县| 芦溪县| 武宣县| 隆德县| 巍山| 瑞安市| 黄大仙区| 沁阳市| 彭州市| 中宁县| 浮山县| 广宗县| 二连浩特市| 珲春市| 防城港市| 鄯善县| 二连浩特市| 宜城市| 桑日县| 西丰县| 法库县| 伊通| 兴安盟| 鄂托克前旗|