图库捕获轨迹球导航
图库水平捕获轨迹球/ dpad导航。
这是一个示例布局,在Gallery的两侧都有按钮:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Gallery
android:layout_height="match_parent"
android:id="@+id/gallery"
android:layout_width="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
当您使用轨迹球导航到图库时,您无法转到任何一侧的按钮。我尝试将android:nextFocusLeft =“@ id / button”添加到库中。我也尝试将它添加到图库适配器的第一个视图中。
有没有办法解决?
没有找到相关结果
已邀请:
1 个回复
刷骸码