2013-04-27 16 views
2

我有一个seekbar,在它的背景中我放了一个标记的图片。这里的背景是 enter image description hereSeekbar背景图像不够大

,但是当我在搜索栏添加它,它显示了这样

enter image description here

这里的代码Absolutlayout 1,我希望它是比格尔。数字必须清楚为用户

<SeekBar 
     android:id="@+id/seekBar1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_x="11dp" 
     android:layout_y="68dp" 
     android:indeterminate="false" 
     android:max="1000" 
     android:progress="5" 
     android:progressDrawable="@drawable/styled_progress" 
     android:thumb="@drawable/thumbler_small" /> 

2-另一个问题是:在我看来,背景重复!我怎么能阻止它?

感谢

回答

2

添加父视图保存研究背景,如LinearLayout中,并把搜索条的背景,它的父视图,就像这样:

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/your_seekbar_background" 
    > 
    <SeekBar 
     android:id="@+id/seekBar1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_x="11dp" 
     android:layout_y="68dp" 
     android:indeterminate="false" 
     android:max="1000" 
     android:progress="5" 
     android:progressDrawable="@drawable/styled_progress" 
     android:thumb="@drawable/thumbler_small" /> 

</LinearLayout> 
+0

谢谢,但什么ü说让PIC背景整个布局,但我希望它只是搜索栏的背景 – Salman 2013-04-27 07:32:14

+0

我的plesure。仅为查找栏添加父容器。看到我更新的答案。 – herbertD 2013-04-27 09:19:00