简体   繁体   中英

Move imageview from scrollview to relativelayout

How to move imageview from ScrollView to RelativeLayout using drag n drop (or else)? Android 2.2/2.3.3+ I Need OnTouch take imageview and smooth move to relativeLayout... Sorry for my English..

I not sure if it is this you want but u could simply go to XML (no graphical layout with drag n drop), cut the ImagaView code and place it outside the ScrollView layout,

Just remember ScrollView can father only one object so u can create a LinearLayout around your image

FROM THIS

<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>

TO THIS

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM