让EditText无法点击编辑和RatingBar无法点击
16lz
2021-12-04
(1)让EditText无法点击
解决办法:
将EditText中设置三个属性就行了
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
如下:
<EditText
android:id="@+id/thhxq_eidt_shuoming"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/shape_rec_little"
android:gravity="left|top"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
android:paddingLeft="5dp"
android:paddingTop="5dp" />
(2)让RatingBar无法点击
ratingbar.setEnable(false);
更多相关文章
- 在Android中扫描wifi热点演示实例教程
- android中判断网络和WIFI是否连接
- Android(安卓)自定义shape圆形按钮
- Android点击2次返回按钮退出应用程序
- android TextView 实现自定义文字点击效果
- Android中的Button自定义点击效果
- Android:CoordinatorLayout使用详解
- LinearLayout按下(pressed)或获取焦点(focused)时背景设置不同颜
- relativelayout常用属性