2013-05-02 63 views
1

我爲我的android應用程序使用2個PNG圖像做了一個自定義的seekbar。一個圖像是背景,另一個是顯示進度的酒吧。兩者的長度和寬度都相同。在小屏幕上(約5英寸),它可以完美顯示,但在較大的屏幕上(〜8英寸),上部小欄上有一個小間隙,下部小欄的一小部分可從間隙中看到,如圖片: enter image description here自定義seekbar在大屏幕上顯示之間的差距?

我檢查了2個.png文件,其中沒有問題。而且,這種差距只能在大屏幕設備上顯示。什麼可能導致這個?

編輯:增加了對搜索條區域中的XML:

<FrameLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="0.1333333333333333" 
    android:scaleType="fitXY"> 
<ImageView 
    android:id="@+id/imageView2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:clickable="false" 
    android:scaleType="fitXY" 
    android:contentDescription="@string/p" 
    android:src="@drawable/volbar" /> 
<SeekBar 
    android:id="@+id/seekBar1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_centerVertical="true" 
    android:layout_margin="10dp" 
    android:scaleType="fitXY" 
    android:minHeight="5dip" 
    android:maxHeight="5dip" 
    android:progressDrawable="@drawable/styled_progress" 
    android:thumb="@drawable/thumb" 
    android:thumbOffset="13.5dp" 
    android:paddingRight="13.5dp" 
    android:paddingLeft="13.5dp" 
    android:indeterminate="false" /> 
</FrameLayout> 
+0

請發佈您的佈局xml文件,謝謝 – 2013-05-02 21:55:11

+0

@AshwiniBhangi添加了搜索欄區域的XML。 – 2013-05-02 22:01:33

回答

0

有一個保證金,並在你的搜索條的填充,可以解釋爲什麼有你的圖像之間的縫隙......

+0

爲@TheBeps添加與ImageView相同的填充和邊距,它應該可以解決您的問題 – 2013-05-03 09:55:47

+0

@AshwiniBhangi imageview是背景黑色區域。向其添加邊距不會使其延伸到設備的整個寬度。 。 – 2013-05-03 10:53:04

+0

@thebeps:謝謝你的回答,但是,如何解決這個問題? – 2013-05-03 10:55:24

相關問題