好久没不做Android的界面就是手生,为了搞下图的效果整了好半天,不过还好最终搞定了。 1.声明明你的layout,并将如下的背景xml设置上去: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/background_pressed"> <item android:state_selected="true" android:drawable="@drawable/background_pressed"> <item android:state_enabled="true" android:drawable="@drawable/background_normal"> </selector> 2.在你需要选中的时候加上以下代码: Layout mLayout = findVeiwById(R.id.xxx); boolean bSelected = true or false; mLayout.setSelected(bSelected );