将单个图像放置在多个位置而不创建图像视图
大家好,我需要将单个图像放置在多个位置。
假设我需要将一张图像放置在布局中的 5 个位置,但仅使用一个
id
<ImageView
android:id="@+id/img"
android:layout_width="340dip"
android:layout_height="240dip"
android:layout_marginBottom="60dip" />
如何实现这一点,请帮忙。
hi guys i need to place a single image in multiple places.
suppose i need to place one image in 5 places in a layout but using only one <ImageView>
id
<ImageView
android:id="@+id/img"
android:layout_width="340dip"
android:layout_height="240dip"
android:layout_marginBottom="60dip" />
how to acheive this please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用此代码使用网格视图:
Main.java:
main.xml: // 布局
Lat 我知道这篇文章是否有任何帮助:)
Use This code for which uses Grid View :
Main.java:
main.xml: // the layout
Lat me know if this post is of any help :)
你可以这样做
,然后在你的主视图中添加这个r1,然后再次更改边距,高度和其他参数,然后再次添加,就像这样你不会多次这样做
you can do like this
and then add this r1 in your main view then again change margin, height and other param and add again like this you do n no of times
您尝试为其添加标签吗?
img.xml
main.xml
Do you try include tag for it?
img.xml
main.xml