<?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="10dip" /> <gradient android:startColor="#ffffffff" android:centerColor="#ffdddddd" android:centerY="0.50" android:endColor="#ffffffff" android:angle="270" /> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="10dip" /> <gradient android:startColor="#77bf0d0d" android:endColor="#77ef5555" android:angle="90" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="10dip" /> <gradient android:startColor="#ffbf0d0d" android:endColor="#ffef5555" android:angle="90" /> </shape> </clip> </item> </layer-list>
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:width="35dip" android:height="35dip" /> <stroke android:width="1dip" android:color="#ffffffff" /> <gradient android:startColor="#ffcdcdcd" android:endColor="#fff8f8f8" android:angle="270" android:type="linear" /> </shape>
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:width="35dip" android:height="35dip" /> <stroke android:width="1dip" android:color="#ff5da8d4" /> <gradient android:startColor="#ff0e75af" android:endColor="#ff1997e1" android:angle="270" android:type="linear" /> </shape>
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:width="35dip" android:height="35dip" /> <stroke android:width="1dip" android:color="#ffffc27e" /> <gradient android:startColor="#ffed6100" android:endColor="#ffffc27e" android:angle="270" android:type="linear" /> </shape>
<style name="CustomSeekBar1" parent="android:Widget.SeekBar"> <item name="android:progressDrawable">@drawable/custom_seek_bar</item> <item name="android:thumbOffset">0dip</item> </style> <style name="CustomSeekBar2" parent="android:Widget.SeekBar"> <item name="android:progressDrawable">@drawable/custom_seek_bar</item> <item name="android:thumb">@drawable/seek_bar_thumb</item> <item name="android:thumbOffset">0dip</item> </style>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <SeekBar android:id="@+id/seekBar1" android:layout_width="match_parent" android:layout_height="wrap_content"/> <SeekBar android:id="@+id/seekBar2" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/CustomSeekBar1"/> <SeekBar android:id="@+id/seekBar3" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/CustomSeekBar2"/> </LinearLayout>
package com.myapp; import android.os.Bundle; import android.app.Activity; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท