2012-03-14 4 views
0

私はlistViewの上に静的ImageViewを持っています。 しかし、imageViewの上に空のスペースがいくつか表示されています。空のスペースImageView

この空き領域を削除するにはどうすればよいですか?

-whenその完全にここで親トップ

でallignedのTextViewの背景はImageViewのための私のxmlであると私はイメージを使用します。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@android:color/background_light" 
> 

<ImageView 
     android:id="@+id/titlebartear" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_marginTop="-5dip" 
     android:src="@drawable/titlebartear" 
     /> 

<ListView android:id="@android:id/list" 
    android:paddingTop="0px" 
    android:tag="fileslist" 
    android:fastScrollEnabled="true" 
    android:smoothScrollbar="true" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:divider="@color/pijndagboek_light_blue" 
    android:dividerHeight="2px" 
    android:cacheColorHint="#00000000" 
    android:layout_below="@id/titlebartear" 
    /> 

</RelativeLayout> 
+0

android:scaleTypeパラメータを試しましたか? http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType; http://developer.android.com/reference/android/widget/ImageView.ScaleType.html – jcxavier

+0

このインテントのすべての.xmlファイルを投稿できますか? (通常はmain.xmlですが、それを変更した可能性があります)。問題はファイル内の別の場所にある可能性があります。 – pogo2065

+0

これは@JamesWrightのレイアウトのすべてです – Luciano

答えて

0

はあなたのImageViewの背景として、あなたの画像を設定します。

<ImageView 
     android:id="@+id/titlebartear" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:background="@drawable/titlebartear" 
     /> 
+0

この種のImageViewを使用する目的は敗北です。 – jcxavier

+0

元の画像にそのスペースがある可能性があるため、スペースが来ています –

+0

私はバックグラウンドとして使用すると画像が正しく表示されます。しかし、私はすでに、-5dip(まだ奇妙な)のmarginTopを設定して解決策を見つけた – Luciano

0

アンドロイド:layout_marginTop = " - 5dip"

が働いた:少し遅くS

3

が、これを越えstubmle他の人に役立つことがあります。

"ViewBoundsの調整"が働いていたが私にとっては、drawableが自動的にViewの高さをスケールします。 (画像自体の上下に空きスペースができます)

関連する問題