關於android 動態設置view 樣式 問題(默認style)


解決方案一:

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);

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM