Я упомянул большинство вопросов в Stackoverflow, связанных с этой темой, и успешно разместил Linear Layout в ScrollView. Но я не могу ее прокрутить. Контуры моей деятельности IS-Невозможно прокрутить LinearLayout, который находится в ScrollView
Вот XML код ScrollView-
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/linearLayoutUP1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewUP1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/Chocolate"
android:gravity="center"
android:padding="10dp"
android:text=" "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/Black"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewUP2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Chocolate"
android:gravity="center"
android:padding="10dp"
android:text="User ID : "
android:textColor="@color/White"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewUP4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Chocolate"
android:gravity="center"
android:padding="10dp"
android:text="Gender : "
android:textColor="@color/White"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewUP3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/Chocolate"
android:gravity="center"
android:padding="10dp"
android:text="Your Groups"
android:textColor="@color/White"
android:textSize="16sp"
android:textStyle="bold" />
<GridView
android:id="@+id/gridViewUP1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="1"
android:padding="5dp" >
</GridView>
</LinearLayout>
</LinearLayout>
</ScrollView>
Как вы можете видеть, что есть GridView в последнем LinearLayout. Этот GridView был прокручиваемым перед добавлением ScrollView. После добавления ScrollView макет с именем «linearLayoutUP1» нельзя прокручивать. Как я могу сделать его прокручиваемым по вертикали?
Вы можете разместить свой код. Для того, чтобы завязать друг друга. – Supriya
отправьте свой xml-файл тоже. – Lal
попробуйте добавить 'android: fillViewport =" true "' в ваш 'ScrollView' – Lal