零散的点
1. osColorControlNormal 及 osColorControlActivated
- EditText 各部分颜色设置小结
- android 隐藏或修改EditText 光标下水滴状图标
- 修改TextView/EditText选中部分'水滴'颜色,可以在xml中修改,也可以在java代码中修改.但是Java代码中获取getTextSelectHandle,getTextSelectHandleLeft,getTextSelectHandleRight,getTextCursorDrawable所需的SDK版本较高. xml中对版本无限制.
2. setElegantTextHeight
- 设置TextView是否支持特定语言'高字体绘制/原始高度绘制'
- TextView默认是关闭'原始高度绘制'的,会对特定语言文字进行压缩后绘制,有时候会导致设置为wrap_content的TextView文字显示不全.
- Java及xml调用方式
/**
* Set the TextView's elegant height metrics flag. This setting selects font
* variants that have not been compacted to fit Latin-based vertical
* metrics, and also increases top and bottom bounds to provide more space.
*
* @param elegant set the paint's elegant metrics flag.
*
* @see #isElegantTextHeight()
* @see Paint#isElegantTextHeight()
*
* @attr ref android.R.styleable#TextView_elegantTextHeight
*/
public void setElegantTextHeight(boolean elegant) {
if (elegant != mTextPaint.isElegantTextHeight()) {
mTextPaint.setElegantTextHeight(elegant);
if (mLayout != null) {
nullLayouts();
requestLayout();
invalidate();
}
}
}
//java调用方式
tv.setElegantTextHeight(true);
***\SDK\platforms\android-30\data\res\values\attrs.xml
<declare-styleable name="TextAppearance">
<!-- Elegant text height, especially for less compacted complex script text. -->
<attr name="elegantTextHeight" format="boolean" />
</declare-styleable>
<!-- xml定义方式 -->
<TextView
***
android:elegantTextHeight="true"
/>