2012-08-29 35 views

回答

2

我得到它,我错过了android:下面大拇指:

<SeekBar 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/seekBar1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_below="@+id/topBar" 
      android:layout_marginTop="26dip" 
      android:paddingLeft="10dip" 
      android:paddingRight="10dip" 
      android:paddingTop="10dip" 
      android:max="10000" 
      style="?android:attr/progressBarStyleHorizontal" 
      android:progressDrawable="@drawable/scrubber_progress_horizontal_holo_light" 

       android:thumb="@drawable/scrubber_control_selector_holo" > 
     </SeekBar> 

在drwable:

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 

    <item android:drawable="@drawable/scrubber_control_disabled_holo" android:state_enabled="false"/> 
    <item android:drawable="@drawable/scrubber_control_pressed_holo" android:state_pressed="true"/> 
    <item android:drawable="@drawable/scrubber_control_focused_holo" android:state_selected="true"/> 
    <item android:drawable="@drawable/scrubber_control_normal_holo"/> 

</selector> 

和:

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

    <item 
     android:id="@android:id/background" 
     android:drawable="@drawable/scrubber_track_holo_light"/> 
    <item android:id="@android:id/secondaryProgress"> 
     <scale 
      android:drawable="@drawable/scrubber_secondary_holo" 
      android:scaleWidth="100%" /> 
     </item> 
    <item android:id="@android:id/progress"> 
     <scale 
      android:drawable="@drawable/scrubber_primary_holo" 
      android:scaleWidth="100%" /> 
    </item> 

</layer-list> 
当然

你需要也从那里的图像。

1

为了使用的主题,你必须在你的水库一“的themes.xml”文件/文件夹值用下面的代码(假设库进口...):

<style name="YourTheme" parent="Theme.HoloEverywhereLight"> 
    <!-- You can customize the theme here! --> 
</style>   

而在你的应用程序的AndroidManifest文件,应用主题:

<application 
    android:icon="@drawable/app_launch_icon" 
    android:label="@string/app_name" 
    android:theme="@style/YourTheme" > 
在活动的main.xml中的布局

然后终于,添加搜索条的地方,如下所示:

<SeekBar 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:progress="75" />