Пожалуйста, помогите мне создать макет, как этот экран: Динамическая компоновка с imageViews
Изображение позиция должна быть как на экране. Все временные изображения масштабируют или изменяют размеры границ.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="3">
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view6"
android:gravity="center"
android:layout_weight="1"
android:layout_gravity="center" />
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2">
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view"
android:gravity="center" />
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view11"
android:gravity="center" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view5"
android:layout_weight="1"
android:gravity="center" />
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view8"
android:layout_weight="1"
android:gravity="center">
</view>
<view
class=".widget.AvatarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/view10"
android:layout_weight="1"
android:gravity="center">
</view>
</TableRow>
</TableLayout>
Но изображения не требуют масштабирования и изменения размера! Я получаю Пожалуйста, помогите, спасибо!
Try [ 'GridLayout'] (http://developer.android.com/reference/android/widget/GridLayout.html) может быть ? –
Вместо 'TableLayout' используйте' LinearLayout' с дополнением, ориентацией и весом. –
@HimanshuAgarwal Я не могу растягиваться с линейной компоновкой – smail2133