首页 > 移动平台 > 详细

关于android 动态设置view 样式 问题(默认style)

时间:2015-05-21 12:20:06      阅读:394      评论:0      收藏:0      [点我收藏+]

解决方案一:

Button btn=new Button(new ContextThemeWrapper(mContext,R.style.service_text_dialog_style),null,R.style.service_text_dialog_style);

解决方案二(待验证):

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="This is a template"
        style="@style/my_style" />
TextView myText = (TextView)getLayoutInflater().inflate(R.layout.tvtemplate, null);

 

关于android 动态设置view 样式 问题(默认style)

原文:http://www.cnblogs.com/duanweishi/p/4519191.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!