我按照 https://github.com/ChristopheVersieux/HoloEverywhere 中的示例來創建Seekbar,如下圖所示。但是,它比我的初學者水平太高級了,創建「ChristopheVersieux/HoloEverywhere」Seekbar
如果有人能告訴我如何做到這一點,我需要相關代碼嗎?
我按照 https://github.com/ChristopheVersieux/HoloEverywhere 中的示例來創建Seekbar,如下圖所示。但是,它比我的初學者水平太高級了,創建「ChristopheVersieux/HoloEverywhere」Seekbar
如果有人能告訴我如何做到這一點,我需要相關代碼嗎?
我得到它,我錯過了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>
當然
你需要也從那裏的圖像。
爲了使用的主題,你必須在你的水庫一「的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" />
你看過他的演示活動嗎? –