【问题标题】:drag and drop on android studio在android studio上拖放
【发布时间】:2017-02-07 10:15:07
【问题描述】:

我是安卓新手。如果有人可以编写实现在图像视图上拖放文本视图的最基本代码,我将不胜感激。或更具体地,将一个字母拖到一个虚线框上,将字母放入框架中。

我在网上找到了很多例子,但都不能正常工作,而且大部分都已经过时了。

【问题讨论】:

标签: android android-studio drag-and-drop


【解决方案1】:

我最近使用以下链接完成了此操作。希望它也能帮助你。 这是在不使用任何外部库的情况下在 android 中拖放视图的简单方法

link

【讨论】:

    【解决方案2】:
    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>
    

    【讨论】:

    • Noam 想要实时拖放视图.. 所以这行不通。
    • 哦,那你需要相当多的触摸和滑动监听器
    • 先尝试一下,然后人们就会准备好提供帮助。如果我们什么都没看到,就没有动力提供帮助。先试试看
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-04
    • 1970-01-01
    • 2012-06-17
    • 1970-01-01
    • 1970-01-01
    • 2017-05-02
    相关资源
    最近更新 更多