/ / Niestandardowy widok siatki w ScrollView - Android, układ, widok siatki

Niestandardowe Gridview w ScrollView - Android, układ, gridview

Mam problem z moim niestandardowym podglądem siatki. Zrobiłem to zgodnie z tym rozwiązaniem Niestandardowy GridView Mam obraz poniżej gridview na wszystkich urządzeniachdziałają poprawnie, z wyjątkiem urządzeń z układem sw360 (Galaxy Nexus, Galaxy S3). Tekst poniżej dwóch ostatnich elementów siatki nie jest w pełni wyświetlany. Dzięki za pomoc i przepraszam za zły angielski

problem

Mój układ

<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<cz.xx.xxx.utils.CustomGridView
android:id="@+id/productGridview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:numColumns="2"
android:listSelector="#00000000"
android:horizontalSpacing="5dip"
android:visibility="visible"
android:background="@null"
android:scrollbars="none"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:layout_marginBottom="20dp">
</cz.xxx.xxx.xxx.CustomGridView>

<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:id="@+id/img_dobre_jistoty"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:clickable="true"
android:contentDescription="obr"
android:src="/images/@drawable/img_cdjabout"
android:onClick="cdjClick"
android:layout_marginBottom="5dp"
android:layout_marginTop="30dp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xxx"
android:id="@+id/textView"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="-3dp"
android:singleLine="true"
android:textColor="#000000"
android:textSize="12dp"
android:textStyle="bold"/>

</LinearLayout>
</ScrollView>

Odpowiedzi:

0 dla odpowiedzi № 1

Możesz użyć android: fillViewport = "true" w widoku przewijania i ustaw wysokość układu zgodnie z treścią.

Lubię to:

<ScrollView
android:layout_width="fill_parent"
android:layout_height="500dp"
android:scrollbars="none"
android:fillViewport="true">