android 常用View的一些注意点(CheckedTextView)


<CheckedTextView
android:id="@+id/btnRunpatrolNoNeed"
android:layout_width="0dp"
android:layout_height="match_parent"
android:textAlignment="center"// 这行才是对齐
android:checked="@{wrokItemBinding.selOkOrNo==2}"
android:background="@color/orange"
android:clickable="@{viewModel.currntUserEtEditable}"
android:gravity="center_horizontal|center_vertical"// 这行不是对齐
    android:text="@string/res_field_no_applicable"
android:textColor="@drawable/res_sel_text_blue_black"/>

<!--tabIndicatorColor:指示器的颜色-->
<!--tabBackground:标签背景-->
<!--tabIndicatorHeight:指示器的高度,可设置为0,相当于没有指示器-->
<!--tabTextColor:Tab未选中时字体的颜色-->
<!--tabSelectedTextColor:Tab选中时字体的颜色-->
<!--tabTextAppearance:Tab内文字的样式,TabLayout没有提供直接属性设置文字大小,需通过该属性指定style样式从而改变文字大小-->
<!--tabMode:Tab的显示模式,默认为fixed(固定不能滑动,标签很多时会被挤压),可设置为scrollable(标签很多时可向左滑动)-->
<!--tabGravity:内容的显示模式,可选center(居中)和fill(填充)-->
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayoutOne"
android:layout_width="wrap_content"
android:layout_height="@dimen/res_activity_editv_hight_defalut"
android:background="@android:color/transparent"
app:tabBackground="@drawable/res_sel_tablayout_bg"
app:tabIndicator="@drawable/work_sel_tab_bg_blue"
app:tabIndicatorColor="@color/res_ui_btn_normal_blue"
app:tabMode="auto"
app:tabPadding="2dp"
app:tabTextAppearance="@style/res_TabLayoutTextStyle"
app:tabTextColor="@drawable/res_tab_text_color_selector" />


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM