Mr.*_*Mr. 2 java android textview android-layout
我很想操纵TextView并动态地将它们设置为large(setTextAppearance()).(我想知道为什么Google总是把XML的代码片段与Java代码放在一起).
有人熟悉怎么做吗?
UPDATE
TextView txtVw = new TextView(this);
tblRow.addView(txtVw);
txtVw.setTextAppearance(this, android.R.attr.textAppearanceLarge);
Run Code Online (Sandbox Code Playgroud)
TextView出现在屏幕上,但它看起来并不大.
Cri*_*ian 10
你尝试过类似的东西:
textView.setTextAppearance(context, android.R.style.TextAppearance_Large);
Run Code Online (Sandbox Code Playgroud)