您的位置:首页 > 移动开发 > Android开发

Android 代码中设置控件的style

2016-07-01 13:08 453 查看
<style name="text">

    <item name="android:textStyle">bold</item>

    <item name="android:textSize">16sp</item>

</style>

xml使用:

<TextView 

style="@style/text_style"

android:layout_width="wrap_content"
android:layout_height="wrap_content"

</TextView>

java代码使用:

TextView txtname = new TextView(this);
txtname.setTextAppearance(this, R.style.text);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android 控件 style