我正在开发一个android应用程序,如果你可以安装你自己的戒指。
现在我想给用户一个预览的戒指,当他们选择了多个戒指。
在这里预览一下它应该是什么样子

我认为如何制作它的设置如下:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="5dp">
<ImageView
android:id="@+id/generator_ring_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e7e7e7"/>
<FrameLayout
android:id="@+id/generator_ring_addon_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</FrameLayout>我将通过在代码中创建一个新的ImageView,以编程的方式添加这个副词。
现在,最难的部分是将图像放在另一个环上,并且在每个屏幕大小上都有相同的视图。
有没有人能帮我得到正确的代码,把图像放在正确的位置上的每一个屏幕大小?
谢谢你的阅读
编辑:
当我选择加载项时,基本环已经可见,所以我可以得到图像的高度
发布于 2017-05-17 09:47:39
用户画图API:像这样的https://developer.android.com/reference/android/graphics/Paint.html https://developer.android.com/reference/android/graphics/Canvas.html,你可以添加任何你想要的图片,通过编程,移动它们,甚至创建动画,如果你愿意。此外,您将只有一个视图,其中包含画布。因此,不需要将FrameLayouts转换为FrameLayouts。如何在画布上绘制图像的示例。draw object/image on canvas
发布于 2017-05-17 10:00:39
使用画布你可以得到戒指的(x,y)坐标。
首先创建带有环形图像的画布,然后使用canvas.draw()在基本图像上绘制另一个图像。
https://stackoverflow.com/questions/44020495
复制相似问题