1、android:focusable="true"
<GridView
android:id="@+id/gv_device"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="3"
android:horizontalSpacing="20dp"
android:verticalSpacing="50dp"
android:layout_margin="50dp"
android:focusable="true"
/>
2、item selector
state_selected尤为重要,上下左右切换就靠这个属性
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@mipmap/xuanzhe"></item>
<item android:state_pressed="true" android:drawable="@mipmap/xuanzhe"></item>
<item android:state_selected="true" android:drawable="@mipmap/xuanzhe"></item>
</selector>