KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to create a vertical linearlayout with weights that has a size bigger than the screen. Let's say 2x the size of the screen. In order for this to work I would obviously need to be able to scroll through it. Unfortunately I can't figure out a way to do this. I tried using the layout weights, and setting the weight sum as half of the actual sum of the weights of all components (so if all components weights sum is 20 I set the weight sum as 10) and managed to make it work but unfortunately the scrolling is not working anymore for some reason. Is there anything that I am missing? this is the code that makes the linearlayout twice as big as the screen but the scroll is not working: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:fillViewport="true"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="2"> <EditText android:id="@+id/id1" android:layout_width="match_parent" android:layout_height="0dp" android:textSize="25dp" android:gravity="center" android:layout_weight="2"/> <EditText android:id="@+id/id2" android:layout_width="match_parent" android:layout_height="0dp" android:textSize="25dp" android:gravity="center" android:layout_weight="2"/> </LinearLayout> </ScrollView>
Tags (comma-separated)
Save Edits
Cancel