English 中文(简体)
变化图象 载于Andin的GridView中的观点内容
原标题:Change ImageView content within a GridView in Android

我是安东和 Java。 我正在建造一个能够让用户推向一个子的电灯,在它能够从纸张上的图像中选择一个图像选择器。 配有2个电池的电网灯。 一个单元有图像,有缺省的形象。 另一个是纽芬兰。 一旦选择了图像,图像观点就需在《格里德观点》的图像观点中展示。

我正在使用一条从图形中解脱的直观道路,以绘制一张图。 然后,我打电话给我图像。 这不是什么。 我试图以不同的形象更新图像资源,在可磨碎的夹中仍然没有任何东西。 我在我的活动中刚刚在电网下添加了适当的图像观点,这一形象正在更新,使我相信这必须与电网的观点(这是我的第一个电网观点)。

任何帮助都受到高度赞赏。

谢谢。

最佳回答

<代码>GridView,如果只有两间囚室,则可能不是正确的选择。 你也许会有更多的时间用简单的<代码>LinearLayout处理两个项目。

但是,在座各位如何用<条码>做到这一点。 GridView:

http://developer.android.com/fer/android/widget/BaseAdapter.html” rel=“nofollow”>BaseAdapter。 最重要的方法是getView(),但你应当做的工作最少。

当<代码>GridView自行重写时,每张显眼位置就座,请打电话getView()。 页: 1 如果意见为<代码>null,则从您的XML资源中删除新的内容,并填满。 如果意见为NOTnull,则以适当数据表示现有数据。 通过循环利用观点,植被正在高效。

你们需要的是,当你们想要改变形象时,你们需要打电话,说明你们的适应者(),以便引发重新布局(即你把新形象传给适当的牢房)。

这是两分钟的版本。 在谷歌一/O一年或两年后,他们就在ListView,并将其张贴在YouTube上。 这是很好的话语,也适用了<代码>GridView。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签