2014-09-29 50 views
0

我嘗試創建一個自定義搜索條是這樣的:http://i.stack.imgur.com/8B0Q8.png如何創建自定義搜索欄並進行優化?

但我遇到問題該問題:http://i.stack.imgur.com/rcQG7.png

我用這個項目來動態改變文本:github.com/Amit-Gupta26/AndroidCustomSeekBar

我的佈局代碼是在這裏:

<RelativeLayout 
android:id="@+id/layout_seekbar" 
android:layout_width="match_parent" 
android:layout_height="0dp" 
android:layout_weight="1" 
android:background="@drawable/seekbar_bg" > 

<SeekBar 
    android:id="@+id/seekbar" 
    style="@style/CustomSeekBar" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="false" 
    android:layout_alignParentTop="false" 
    android:layout_centerHorizontal="true" 
    android:layout_centerVertical="true" /> 

我嘗試了許多不同的方法。但我無法在所有屏幕上實現穩定。 這怎麼辦?

回答

0

我認爲這篇文章將幫助您:

Custom Seekbar

還需要使用9patch圖像

0

看着你所面臨的問題後,我相信,你的問題不是如何建立一個自定義的搜索欄,但如何控制拇指大小和每個單獨的條形大小,如使得爬得更大,而不必使條形或結尾很大,我看到你必須看看hereherehere