8
ImageViewの周りの不要なパディング
すべてのアクティビティ/ビューにヘッダーグラフィックを含める必要があります。ヘッダーを含むファイルはheader.xmlと呼ばれます。 <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#0000FF" android:padding="0dip"> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/header" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="0dip" android:layout_marginTop="0dip" android:layout_marginBottom="0dip" android:padding="0dip" android:paddingTop="0dip" android:paddingBottom="0dip" android:layout_gravity="fill" android:background="#00FF00" /> </FrameLayout> android:background="#00FF00"(緑色)に注意してください。それは単に視覚化の目的です。 私はそれらを次のように私の見解に含めます: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" style="@style/white_background"> <include layout="@layout/header" /> (...) そのため、実際に試してみると、結果は右のように見えるのではなく、左の画像のようになります。 (1)これ-オレンジ-部分は問題の画像/ ImageViewです (2)愛されていない緑の境界線。注:通常、緑の領域は透明になります-を設定したので、緑の領域のみが表示されますbackground。 上部の画像の周りの緑の境界線に注意してください。それはImageViewの一部であり、なぜそこにあるのか、どうやってそれを取り除くことができるのか理解できません。すべてのパディングとマージンを0に設定します(ただし、省略した場合の結果は同じです)。画像は480x64px jpeg *であり、res / drawableに配置しました(drawable-Xdpiただし、1つではありません)。 (* …