Вы можете определенно вложенные LinearLayout
элементы с множественными ориентациями. Например:
<LinearLayout
android:id="@+id/main_layout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/firstRow"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" >
...
</LinearLayout>
<LinearLayout
android:id="@+id/secondRow"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" >
...
</LinearLayout>
<LinearLayout
android:id="@+id/thirdRow"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" >
...
</LinearLayout>
</LinearLayout>
Использование подобной структуры позволит вам построить макет, который вы описали.
Для динамических строк вы можете сделать следующее:
layout_row.xml
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" />
MainActivity.java
mainLayout = (LinearLayout) findViewById(R.id.main_layout);
// for each dynamic row you can inflate a new view and add it
dynamicRow1 = getLayoutInflater.inflate(R.layout.layout_row, null);
mainLayout.addView(dynamicRow1);
dynamicRow2 = getLayoutInflater.inflate(R.layout.layout_row, null);
mainLayout.addView(dynamicRow2);
dynamicRow3 = getLayoutInflater.inflate(R.layout.layout_row, null);
mainLayout.addView(dynamicRow3);
В каждой строке можно программно добавить динамический которые необходимо создать с использованием логики того же типа.
привет! u можете использовать макет для нового xml-файла ... u можете прочитать о том, как Android предлагает это здесь. http://developer.android.com/guide/topics/resources/providing-resources.html – Aamirkhan
u можете использовать layout- земля для нового xml-файла ... u может прочитать о том, как Android предлагает это здесь. http://developer.android.com/guide/topics/resources/providing-resources.html – Aamirkhan