我并排布置了两个按钮。当用户使用键盘选择按钮时,我想关注按钮,但是不知道如何在两个按钮之间切换焦点。
这里是我的布局
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="button1"
android:id="@+id/button" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="button2"
android:id="@+id/button2" />
</LinearLayout>