且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何动态地创建一个视图和机器人加上主视图?

更新时间:2023-11-19 12:34:40

假设你的主要观点是的的ViewGroup ,你已经拥有它的实例的code会是这个样子:

Assuming that your main view is a ViewGroup and you already have an instance of it the code would look something like this:

TextView textView = new TextView(getContext());
textView.setText("Processing...");
mainView.addView(textView);