So, i have a linear layout and a textview (both wrapped in scrollview). I want to place textview at bottom of screen initially (I DONT want it to be fixed at the bottom). I followed this question Adding view to bottom of layout inside a scrollview but it didn't help. Here's my layout. (all layout_width attribute is match_parent)
<ScrollView
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:layout_height="0dp"
android:layout_weight="1">
<!-- this expands to fill the empty space if needed -->
</LinearLayout>
<!-- this sits at the bottom of the ScrollView,
getting pushed out of view if the ScrollView's
content is tall enough -->
<TextView
android:layout_height="wrap_content"
android:text="something">
</TextView>
</LinearLayout>
</ScrollView>
The problem is the textview is never visible. Could you tell what I can do to fix it? (Initially there is enough space for linear layout and textview to fit in screen) PS: please dont mark as duplicate, as all other related questions want the textview to be FIXED at bottom.