首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将图像视图从滚动视图移动到相对布局

将图像视图从滚动视图移动到相对布局
EN

Stack Overflow用户
提问于 2012-03-10 01:52:59
回答 1查看 478关注 0票数 0

如何使用dragndrop (或其他)将imageview从ScrollView移动到RelativeLayout?Android2.2/2.3.3+我需要OnTouch使用imageview并平滑地迁移到relativeLayout...对不起,我的英语..

EN

回答 1

Stack Overflow用户

发布于 2012-03-10 02:49:45

我不确定这是否是您想要的,但您可以简单地转到XML (不带拖放的图形布局),剪切ImagaView代码并将其放在ScrollView布局之外。

请记住,ScrollView只能为一个对象设置父对象,因此您可以在图像周围创建LinearLayout

从这里开始

代码语言:javascript
复制
<ScrollView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_above="@id/adView1">  


    <RelativeLayout
        android:id="@+id/relativeLayout2"
        android:layout_width="fill_parent"
        android:layout_height="352dp" >

    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/buttongod" />

</RelativeLayout>

</ScrollView>

到这个

代码语言:javascript
复制
<ScrollView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_above="@id/adView1"  


    <RelativeLayout
        android:id="@+id/relativeLayout2"
        android:layout_width="fill_parent"
        android:layout_height="352dp" >


</RelativeLayout>

<LinearLayout
android:layout_width="wrap_content"
        android:layout_height="wrap_content"


<ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/buttongod" />

</LinearLayout>

</ScrollView>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9638694

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档