私は最初のスクリーンショットとしてレイアウトを作りたいと思います。 アンドロイドに配置/オーバーラップ(z-インデックス)
、私が実行しようとしましたが、それは私がどのように我々は他の上にあるビューを配置することができます知ってほしい私のレイアウト
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="20dip" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@color/red"
android:orientation="vertical"
android:paddingBottom="40dip"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="10dip" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black"
android:gravity="center_vertical" >
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-20dip" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="lololo" />
</ScrollView>
<ImageView
android:id="@+id/lady"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/temp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-20dip"
android:gravity="center" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_left"
android:text="next" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_right"
android:text="prev" />
</LinearLayout>
</LinearLayout>
ここで第二のスクリーンショットのように
を判明変化するz-インデックスを持つ? Zインデックスを変えて、あるビューを他のビューの上に配置するにはどうすればいいですか? Zインデックスを変えて、あるビューを他のビューの上に配置するにはどうすればいいですか?
あなたはScrollViewの親を変更しようとしたとのLinearLayoutからでframeLayout –
にImageViewのはい、それは私がいけない – silentnuke
は、z順序はあなたのレイアウトを見れば、私は何を考えてあなたを助けると思って助けにはならなかったがありますあなたが行っているのは、あなたの内側の線形レイアウトでtextviewを作成したことです.zオーダーを設定すると、それは他の兄弟と前になりますが、私はあなたがそれを望んでいないと思っています。私はあなたのtextviewを線形レイアウトまたはその親...私はあなたが相対的なレイアウトですべてを変更する必要があると思ういくつかのダミーのビューと決済でうまくいくでしょう。 –