Blog purpose for android basic example for android app developer. any query please my contact

Tuesday, 7 September 2021

what is scrollview in android

 what is scrollview in android


In this article today learn android Scrollview follow the example. for more information visit https://stackoverflow.com/questions/6674341/how-to-use-scrollview-in-android


In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. ... A ScrollView supports Vertical scrolling only, so in order to create a horizontally scrollable view, HorizontalScrollView is used.




What is a ScrollView?

android.widget.ScrollView. A view group that allows the view hierarchy placed within it to be scrolled. Scroll view may have only one direct child placed within it.



ScrollView example:


<ScrollView

  android:layout_width="match_parent"

  android:layout_height="match_parent">

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="vertical" >   

        

          <TextView

              android:id="@+id/tv_long"

              android:layout_width="wrap_content"

              android:layout_height="match_parent"

              android:text="@string/really_long_string" >

          </TextView>

  

          <Button

              android:id="@+id/btn_act"

              android:layout_width="wrap_content"

              android:layout_height="wrap_content"

              android:text="View" >

          </Button>

    </LinearLayout>

</ScrollView>

No comments:

Post a Comment