【发布时间】:2017-02-07 10:15:07
【问题描述】:
我是安卓新手。如果有人可以编写实现在图像视图上拖放文本视图的最基本代码,我将不胜感激。或更具体地,将一个字母拖到一个虚线框上,将字母放入框架中。
我在网上找到了很多例子,但都不能正常工作,而且大部分都已经过时了。
【问题讨论】:
-
试过了。可拖动的只是在放置时消失。
标签: android android-studio drag-and-drop
我是安卓新手。如果有人可以编写实现在图像视图上拖放文本视图的最基本代码,我将不胜感激。或更具体地,将一个字母拖到一个虚线框上,将字母放入框架中。
我在网上找到了很多例子,但都不能正常工作,而且大部分都已经过时了。
【问题讨论】:
标签: android android-studio drag-and-drop
我最近使用以下链接完成了此操作。希望它也能帮助你。 这是在不使用任何外部库的情况下在 android 中拖放视图的简单方法
【讨论】:
Noam, I think you should just check out the xml file and edit the code without draging and dropping
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/image">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@String/textOnImage">
</ImageView>
【讨论】: