私は、レイアウト内のアイテムを、含まれているレイアウト内のアイテムに関して整列させる方法を見つけようとしています。ここで
は視覚的な表現です: layout_below item within includedレイアウト
そして、ここで私は(明らかに動作しません)を探していますサンプルコードです:
Main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<include
android:id="@+id/info"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/info" />
//This would be the dark grey box
<RelativeLayout
android:layout_below="@id/item1">
</RelativeLayout>
</RelativeLayout>
included.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="50dp">
<ImageView
android:id="@+id/item1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="100dp"/>
</RelativeLayout>
私はこれを実現する最良の方法は、動的にコード内の濃い灰色のボックスを配置してなりと仮定しているが、私はどこから始めれば見当がつかない。どんな助けも素晴らしいだろう。
あなたはあなたが望むものを行うことはできません。私の考え方からすれば、それはしたくないでしょう。その余分なウィンドウをコードに追加してみてください。 – Luksprog
このソリューションは私のために働いたhttps://stackoverflow.com/a/45450305/563735 –
このソリューションは私のために働いたので。 https://stackoverflow.com/a/45450305/563735 –