Skip to content Skip to sidebar Skip to footer

Textview Scrolling Behind The Imageview

In my application I want to scroll the TextView over the ImageView, but in my XML Design the TextView scroll behind the ImageView, how to scroll the TextView on ImageView, please g

Solution 1:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/ic_launcher"
    android:orientation="vertical" >

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="100dp"
                android:text="@string/hello_world" />
        </LinearLayout>
    </ScrollView>

</LinearLayout>

Solution 2:

For this scenario, try using Relative Layout than Frame Layout as it provides many more features and better possibility to handle the positioning of views in it. The implementation will be nearly the same just place Image View first and then the rest of the views for this case.


Post a Comment for "Textview Scrolling Behind The Imageview"