下载源代码时显示转轮而不是图像
我将创建一个图库视图,用户可以在其中切换不同的产品图片。其中一些将带有“销售”之类的标签和简短的描述。启动时,我想在该位置显示加载动画,直到下载产品照片。
- 对一张产品照片使用图层列表或状态列表?
- 您能告诉我如何设置吗?
- 如何让那个旋转器旋转?
- 如何打开或关闭(如何通过代码访问图层列表)?
顺便说一句,“spinner”是 的最佳词吗?这个?它似乎代表了几件事。如果我没有说错的话,请随意编辑这个问题。
I am going to create a gallery view where the user shall switch between different pictures of products. On some of them is going to be a label like "sale" and a short discription. On startup I want to display a loading animation at that place until the product photo is downloaded.
- Use layer list or state list for one product photo?
- Could you please show me, how to set that up?
- How to make that spinner spin?
- How to turn it on or off (how to access the layer list through code)?
By the way, is "spinner" the best word for this? It seems to stand for several things. Feel free to edit this question, if I didn't hit the right words.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能两者都不是。在
ImageView
中显示您的自定义AnimationDrawable
,然后在产品照片可用时将该图像替换为产品照片。确保您注意视图回收——如果用户在您获取照片时滚动,则在照片完全下载时,该照片可能不属于屏幕。使用
AnimationDrawable
你的进度指示器。当您不再希望显示进度指示器时,替换 ImageView 中的图像
不。Android 中的
Spinner
是一个下拉选择小部件。我会使用“进度指示器”作为术语。Probably neither. Show your custom
AnimationDrawable
in theImageView
, then replace that image with the product photo when it is available. Make sure you pay attention to view recycling -- if the user scrolls while you are fetching a photo, it may be that the photo does not belong on the screen by the time the photo is fully downloaded.Use an
AnimationDrawable
for your progress indicator.Replace the image in the ImageView when you no longer wish to display the progress indicator
No.
Spinner
in Android is a drop-down selection widget. I would use "progress indicator" as the term.