不用xml,而是用代码渲染页面,也不用重写 onCreate()方法
let activity = plus.android.runtimeMainActivity();
let TextView = plus.android.importClass("android.widget.TextView");
let textView = new TextView(activity);
textView.setText("Hello World");
let LinearLayout = plus.android.importClass("android.widget.LinearLayout");
let layout = new LinearLayout(activity);
layout.addView(textView);
activity.setContentView(layout);
1 个回复
8***@qq.com
不用xml,而是用代码渲染页面,也不用重写 onCreate()方法