如何使用dragndrop (或其他)将imageview从ScrollView移动到RelativeLayout?Android2.2/2.3.3+我需要OnTouch使用imageview并平滑地迁移到relativeLayout...对不起,我的英语..
发布于 2012-03-10 02:49:45
我不确定这是否是您想要的,但您可以简单地转到XML (不带拖放的图形布局),剪切ImagaView代码并将其放在ScrollView布局之外。
请记住,ScrollView只能为一个对象设置父对象,因此您可以在图像周围创建LinearLayout
从这里开始
<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>到这个
<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>https://stackoverflow.com/questions/9638694
复制相似问题