布局中难免会使用到 RelativeLayout , 有时候会为之设置监听,今天在使用的时候发现 RelativeLayout 响应不了setOnClickListener() ,查了资料才发现,需要给RelativeLayout设置两个属性 :
android:clickable="true" 与 android:focusable="true"
布局中难免会使用到 RelativeLayout , 有时候会为之设置监听,今天在使用的时候发现 RelativeLayout 响应不了setOnClickListener() ,查了资料才发现,需要给RelativeLayout设置两个属性 :
android:clickable="true" 与 android:focusable="true"