簡體   English   中英

如何使用自動創建和調整圖像視圖大小進行布局

[英]How can i do layout with auto creating and resizing Image Views

我需要使用自動重新縮放的圖像視圖創建布局,但是我不知道如何。 我有一個樣本fill_parent布局200dp。 如何在此布局中添加五個,六個或十個等圖像視圖? 我將不勝感激。

第一張圖片

在此處輸入圖片說明

adjustViewBounds是用於保留寬高比的參數。

<ImageView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    ...

您可以將ImageView放置在幾乎任何容器中,但是我發現,使adjustViewBounds="true"工作的技巧是應該固定一個尺寸(即“ match_parent”或說“ 320dp”),並且另一個維度應該是可變的(即“ wrap_content”)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM