android - How to scroll from code to make a view shown in the screen? -
I have a ScrollView that includes 1 button and 3 text visuals. Currently buttons and first textview are shown on screen and They are capturing the entire screen. The second textview is below the textview and is out of the screen. When the user clicks the button, I want the code to scroll to the second text view that appears at the top of the screen. Can someone tell me how to do this? Thanks!
& lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: orientation = "vertical" & gt; & Lt; ScrollView Android: AD = "@ + ID / ScrollView" Android: Layout_Wind = "FailPart" Android: Layout_Hight = "Wrap-Content" Android: Fading Edge = "None" & gt; & Lt; LinearLayout Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: orientation = "vertical" & gt; & Lt; Button Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: id = "@ + id / test" /> And lieutenant; TextView Android: Layout_width = "Filled_perrent" Android: Layout_heat = "Wrap-content" Android: ID = "@ + ID / Lesson 1" /> & Lt; TextView Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: id = "@ + id / text2" /> And lieutenant; TextView Android: layout_width = "fill_preview" Android: layout_height = "wrap-content" android: id = "@ + id / text3" /> & Lt; / LinearLayout & gt; & Lt; / Scrollview & gt; & Lt; / LinearLayout & gt;
Comments
Post a Comment