2012-02-23 18 views
0

私は2つの画像でレイアウトxmlを構築し、LinearLayoutバックグラウンドとして画像も配置します。 問題は、私のトップイメージがメインスクリーンの下で10ピクセルから始まり、次にLinearLayoutバックグラウンドイメージのトップを見たことです。レイアウトXmlと画像

<?xml version="1.0" encoding="utf-8"?> 
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:background="@drawable/hazmanag" android:layout_gravity="top"> 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:src="@drawable/uph" 
     android:layout_gravity="top|center"/> 

     <ImageView 
      android:id="@+id/imageView2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:src="@drawable/coupon" android:layout_gravity="top|center"/> 

    </LinearLayout> 
+0

メイン画面の下で10pxになると、タイトルバーについて話していますか? –

+0

私はメイン画面を持っています。ステータスバーの下には、バックグラウンドイメージが表示され、ステータスバーの最初のイメージが表示されます。 – MTA

+0

マージンを特に設定しようとします。 –

答えて

0

あなたはこのような何か試してみてください:あなたは、画面の任意の場所にオブジェクトを配置することができますので、あなたはすべての方向上、下、左、右にAndroidのマージンを定義している

<ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop = "50dp" 
     android:src="@drawable/uph" 
    android:layout_gravity="top|center"/> 

を!

関連する問題