键盘按钮效果

 <RelativeLayout 
		        android:layout_width="wrap_content"
		        android:layout_height="wrap_content"
		        android:layout_weight="1"
		        android:gravity="center"
		        >
		         <ImageButton 
	                android:id="@+id/dial_num_1"
	                android:layout_width="fill_parent"
	                android:layout_height="fill_parent"
	                android:background="@drawable/bottom_selector"/>
		         <ImageView
		            android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_weight="1"
	                android:layout_centerInParent="true"
	                android:background="@drawable/dial_num_1_pressed"
		             />
		    </RelativeLayout>

 

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/btn_list_item_pressed" /> <!-- pressed -->
<item android:state_focused="true" android:drawable="@drawable/btn_list_item_pressed" /> <!-- focused -->
<item android:drawable="@drawable/btn_list_item_normal" /> <!-- default -->
</selector>
 

 

 

你可能感兴趣的:(键盘)