开发者

Placing TextView in grid in different resolutions

开发者 https://www.devze.com 2023-02-03 02:08 出处:网络
I need to make an Activity in Android that has a grid 开发者_运维知识库(20x8) drawn in the background with cells of different styles. I have 3 background images for the 3 ldpi-mdpi-hdpi resolutions.

I need to make an Activity in Android that has a grid 开发者_运维知识库(20x8) drawn in the background with cells of different styles. I have 3 background images for the 3 ldpi-mdpi-hdpi resolutions.

The problem is that I need to place a TextView in every cell but if I put it in an absolute position for a resolution (eg. ldpi) it is not in the right position for mdpi and hdpi.

Which is the Android approach to solve it?


I would use a GridView so I can specify the layout for every item inside. Check this tutorial: Hello, GridView.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号