亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Gridview有兩列和自動調整大小的圖像

Gridview有兩列和自動調整大小的圖像

素胚勾勒不出你 2019-08-09 15:29:15
Gridview有兩列和自動調整大小的圖像我正在嘗試用兩列制作gridview。我的意思是每排并排兩張照片,就像這張照片一樣。但是我的照片之間有空格,因為它的大小不一樣。這是我得到的。如您所見,第一張圖片隱藏了顯示聯系人姓名和電話號碼的圖例。而其他圖片未正確拉伸。這是我的GridView xml文件。如您所見,columnWidth設置為200dp。我希望它是自動的,所以圖片會自動調整每個屏幕尺寸的大小。<?xml version="1.0" encoding="utf-8"?><GridView      xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/gridViewContacts"     android:layout_width="fill_parent"      android:layout_height="fill_parent"     android:numColumns="2"     android:columnWidth="200dp"     android:stretchMode="columnWidth"         android:gravity="center" />這是項目xml文件,它代表每個項目本身。<?xml version="1.0" encoding="utf-8"?><RelativeLayout      xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent" >     <ImageView         android:id="@+id/imageViewContactIcon"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:scaleType="fitXY" />     <LinearLayout         android:id="@+id/linearlayoutContactName"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="horizontal"         android:paddingLeft="5dp"         android:paddingTop="5dp"         android:paddingBottom="5dp"         android:background="#99000000"         android:layout_alignBottom="@+id/imageViewContactIcon">         <TextView             android:id="@+id/textViewContactName"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textColor="#FFFFFF"             android:textStyle="bold"             android:textSize="15sp"             android:text="Lorem Ipsum" />            </RelativeLayout>所以我想要的是每行顯示兩個圖像,并且無論屏幕大小如何,圖像都會自動調整大小。我在布局上做錯了什么?
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 534 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號