2013-02-10 27 views
0

我想爲帶有4dp填充的此圖像放置邊框,但是當我將背景設置爲我想要的顏色時,我會在頂部和底部獲取所有黑色邊框。我如何擺脫這一點,所以我正確設置邊界?帶有邊框的ImageView的怪異視圖

回答

0

當我明白你的問題不知道如果我真的得到了你想要

以線性佈局,敷線佈局內的ImageView的話,給的背景顏色,無論你想在圖像的線性佈局什麼鑑於保證金給你想要的邊界

<ScrollView> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:padding="10dip" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"> 
<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="10dip" 
    android:text="@string/dealer_picker" /> 

<Spinner 
    android:id="@+id/spinner" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:prompt="@string/dealer_picker" /> 
<LinearLayout 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:background="#1E1E1E"> 
<ImageView 
    android:id="@+id/mapView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:MARGINHERE SAY 10 dp or whatever /> 
</LinearLayout> 

<TextView 
    android:id="@+id/adresa" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="10dip" /> 
</LinearLayout> 
</ScrollView> 
+0

不工作。從頂部和底部的大黑色邊框仍然存在 – 2013-02-10 17:21:38

+0

嘗試高度fillparent,而不是告訴我 – 2013-02-10 17:23:41

+0

仍然無法正常工作。 – 2013-02-10 17:27:43

0

此修復程序是添加任何寬度:android:adjustViewBounds="true"到ImageView的

+0

我有確切的問題,但訣竅不適用於我:( – ercan 2014-03-26 12:51:41