【发布时间】:2014-07-11 09:07:14
【问题描述】:
在我的 Android 活动中,我尝试在现有视图中动态添加视图。
我使用以下代码:
LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = vi.inflate(R.layout.newactivity_name, null);
View insertPoint = findViewById(R.id.aVerticalLinearLayout);
((ViewGroup) insertPoint).addView(v, 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
一切似乎都很好,除了颜色/主题搞砸了 使所有表单小部件看起来都非常褪色。
我希望它看起来如何: How it is displayed in the xml graphic display
外观: how it appears on the emulator after being inflated(忽略文字:提示不同)
有什么想法吗?
或者你能告诉我如何手动使calenderView和DatePicker看起来正常吗 设置颜色?
【问题讨论】:
标签: android view colors widget