回答
在ImageView
中,您可以将红色圆形图像设置为background
,将主图像设置为src
并将其设置为scaleType
。
否则你的两个ImageView在FrameLayout
或RelativeLayout
。
但是,您需要确保超出红色边界的颜色应该是不透明的并填充背景颜色。 它就像隐藏了图像顶部的内部图像的额外部分。
添加的代码:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/imageView_main_image"
android:background="@drawable/your_main_image_here"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/imageView_background_image"
android:layout_alignRight="@+id/imageView_main_image"
android:layout_alignBottom="@+id/imageView_main_image"
android:layout_alignLeft="@+id/imageView_main_image"
android:layout_alignTop="@+id/imageView_main_image"
android:background="@drawable/your_border_image_here"/>
</RelativeLayout>
你能提供一些代码 – 2014-11-22 18:45:03
@gaerdarrd做了这项工作吗? – AabidMulani 2014-11-22 19:11:46
不,它不起作用 - 由于边框图像,图像完全掩盖了框架 – 2014-11-22 19:17:39
可以在ImageView的和图像本身作为ImageView的的src
使用fragme可绘制为background
,像这样
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/frame"
android:src="@drawable/image"/>
这不起作用 – 2014-11-22 18:36:22
- 1. 如何保存附加到图像视图的图像?
- 2. 多个背景图像,附加图像
- 3. 附加图像
- 4. 添加图像到视图
- 5. 将手势识别器附加到多个图像视图
- 6. 将图像从解析图像加载到图像视图
- 7. 将div附加到图像
- 8. 附加到图像文件
- 9. iOS 4.3:难以将图形附加到图像视图
- 10. 如何将多个图像添加到图像视图
- 11. MFMailComposerView附加图像
- 12. 附加升图像
- 13. 如何从一个图像视图拖动图像并放到另一个图像视图。
- 14. 在Android中,我如何设计一个像附加图像的视图?
- 15. 将图像视图添加到图层
- 16. 将图像从一个视图传递到其他图像
- 17. Android图像从URL到图像视图
- 18. 如何在Corona中将图像附加到另一个图像上?
- 19. 将图像分组到一个图像
- 20. 改变图像到另一个图像
- 21. 将图像移到另一个图像
- 22. 通用图像加载器:错误的位图被附加到视图
- 23. 在一个图像视图中的多个图像
- 24. 将图像从保存箱加载到我的图像视图
- 25. 如何将图像添加到图像视图
- 26. 将图像从解析加载到图像视图
- 27. 将很多图像加载到钛图像视图
- 28. C# - 将图像加载到图像列表和列表视图
- 29. 将图像加载到附加元素
- 30. jquery添加类到附加图像
请把更多的代码 – AabidMulani 2014-11-22 18:31:06
这里是它应该是什么样子:应该是这样的:https://onedrive.live.com/redir?resid= 90D26B3C24DAF89C%21123 – 2014-11-22 18:31:24