android - GridLayout 的问题
高洛峰
高洛峰 2017-04-17 16:10:01
0
3
322

这样的,我要显示9张图片,像九宫格那样去显示,
然后呢,我用GridLayout去显示,设置成 3×3 的:
但是,因为图片有点大,三张图片一行,放不下,然后就超出
屏幕的显示范围了,怎么破?
GridLayout 下,没有 weight 属性设置。。。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
阿神

GridLayout has a weight attribute, called layout_columnWeight. Please check the documentation for details.

迷茫

android:scaleType="centerCrop" It would be better if it matches the .9 format

PHPzhong
  1. Set the weight of the child control

android:layout_rowWeight sets the proportion of rows
android:layout_columnWeight sets the proportion of columns

Note: These two properties are only available in API 21 or higher.

2- Only controls such as ImageView have: android:scaleType="centerCrop" attribute setting

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!