本例横向显示UI控件,并使用了nextFocusRight 明确为Button 指定按右键时下一个获取焦点的UI控件为rightButton (跳过中间的Button),但是从右到左时还是按照缺省顺序。

<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_height=”wrap_content”
android:layout_width=”match_parent”
android:orientation=”horizontal”>

<Button android:id=”@+id/leftButton”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginRight=”3dip”
android:text=”@string/focus_2_left”
android:nextFocusRight=”@+id/rightButton”/> <!– jump over middle! –>

<Button android:id=”@+id/centerButton”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginRight=”3dip”
android:text=”@string/focus_2_jump” />

<Button android:id=”@+id/rightButton”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginRight=”3dip”
android:text=”@string/focus_2_right”/>

</LinearLayout>

Focus->2. Horizontal_第1张图片" src="https://img.it610.com/image/product/f6c657e7268d438ba7fe3cf432162208.jpg" title="20110624002" width="650" style="border:1px solid black;">

更多相关文章

  1. Android——自定义自适应高度的GridView
  2. Android布局控件的继承关系
  3. Android实现底部切换标签
  4. Android界面的架构图
  5. Android(安卓)动态设置控件的布局
  6. Android开源项目推荐之【图片选择器】
  7. Android(安卓)重写ViewGroup 分析onMeasure()和onLayout()方法
  8. android 在java代码中动态设置控件的位置和设置片大小
  9. android中常用布局

随机推荐

  1. android 开源项目汇总
  2. Android获取系统时间
  3. android 学习资料
  4. android播放音乐
  5. android实现xml数据的解析
  6. Android CalendarView 使用
  7. Android DOM解析XML
  8. Android自定义弹窗进度条
  9. ch029 Android service aidl
  10. Accessing internal data on Android dev