安卓定制的GridView布局(TextView中使用ImageView的顶部) [英] Android custom gridview layout (textview with imageview on top)

查看:185
本文介绍了安卓定制的GridView布局(TextView中使用ImageView的顶部)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何创建布局一个GridView为我的比赛。我有一个GridView,这将是电平选择。目前,我让每个GridView的项目作为一个TextView,只是显示的级别数(1,2,3,等)。

I'm trying to work out how to create the layout for a gridview for my game. I have a gridview which will be the level selector. At the moment I have each gridview item as a TextView, just showing the Level Number (1, 2, 3, etc).

我想在TextView的顶部添加3 imageviews并能够处理在视图中显示的图像。 3图像观点星,显示什么难度水平完成了。

I would like to add 3 imageviews over the top of the textview and be able to manipulate the image shown in the views. The 3 image views are stars, showing what difficulty the level was completed on.

我想我需要写我自己的适配器,创造电网项目的意见,但我只能和如何创建实际的布局这个当膨胀的XML布局,重叠的部分有我抓我的头?

I figure I need to write my own Adapter and inflate the XML layout when creating the views for the grid items but I'm stuck with how to create the actual layout for this, the overlapping part has me scratching my head?

下面是一个什么样我试图描述一个实体模型,以及我想创造:

Here's a mockup of what I've tried to describe, and what I want to create:

PS。我知道我可以用4个图像,并设置TextView的背景,这些图像之一,但我想知道是否有创建布局的更多的技术方法。

PS. I know I could use 4 images and set the textview background to one of those images but I wondered if there was a more technical way of creating the layout.

推荐答案

我跟到底联合国技术4图像,它是简单和容易,而且没有通过电网滚动所以这一切都很好的任何问题

I went with the un-technical 4 images in the end, it was simple and easy and there aren't any issues scrolling through the grid so it's all good.

这篇关于安卓定制的GridView布局(TextView中使用ImageView的顶部)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆