自定义列表视图项图形布局的Andr​​oid

自定义列表视图项图形布局的Andr​​oid

本文介绍了自定义列表视图项图形布局的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我的无知,但是这是我的第3天与Android,我已经看了教程,他们似乎都集中在ListView项UI的XML声明。我的问题是这样的,我希望能够看到设计师图形布局Eclipse中的自定义列表视图项UI。然而,就像它在Android的,即任何其他视图则显示它。在顶部标题和状态栏和占用整个屏幕。我想看到的是只是我设计即ListView项。只是50dp高大,充满宽度。有没有办法做到这一点?

Please forgive my ignorance, but this is my 3rd day with Android, and I've looked at tutorials, and they all seem to focus on the xml declaration of listview item UI. My question is this, I'd like to be able to see the custom listview item UI in the designer "Graphical Layout" in Eclipse. However, it displays it just like it does any other view in Android, ie. with the title and status bar at the top and taking up the entire screen. What I'd like to see is just the listview item that I'm designing ie. just 50dp tall and filled width. Is there a way to do this?

推荐答案

我相信你所寻找的是一个自定义适配器。
 你们看到的只是ListView项,你正在寻找的是自定义布局。看看本教程中,特别是在设计自定义布局和自定义适配器的部分。

I believe what you are looking for is a custom adapter. What you are seeing is just the listview item, what you are looking for is the custom layout. Have a look at this tutorial, specifically the part on designing the custom layout and the custom adapter.

这篇关于自定义列表视图项图形布局的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 10:24