机顶盒开发和手机开发最大的区别就在于view的事件处理上了,机顶盒开发没什么touch事件,而机顶盒是用遥控器去操作界面交互的,而手机是用手去操作界面的,所以我们用遥控器去操作界面表示你焦点在哪个view上,一般都在该view上把背景设置为和其他的view有区别或者是放大的效果,这样体验起来效果就更好,现在写个demo体验下,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="600dp"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button1"
/>
<Button
android:id="@+id/button2"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button2"
/>
<Button
android:id="@+id/button3"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button3"
/>
<Button
android:id="@+id/button4"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button4"
/>
<Button
android:id="@+id/button5"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button5"
/>
</LinearLayout>
<LinearLayout
android:layout_width="600dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="40dp"
>
<Button
android:id="@+id/button6"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:text="button6"
/>
<Button
android:id="@+id/button7"
android:layout_width="400dp"
android:layout_height="wrap_content"