是否可以只将 Phonegap 用于应用程序的一部分?
例如在 Android 上(但我的问题也包括其他操作系统),Activity 可以使用 Phonegap 组件和 native 组件(在同一屏幕中)吗?
谢谢。
最佳答案
下面的小经验似乎满足了我的需求,至少在 Android 上是这样。我想可以在其他操作系统上进行类似的破解。
public class TestPhonegapActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadUrl("file:///android_asset/www/index.html");
LinearLayout linearLayout = new LinearLayout(this);
((ViewGroup) appView.getParent()).removeView(appView);
linearLayout.addView(appView);
TextView textView = new TextView(this);
textView.setText("Native");
linearLayout.addView(textView);
setContentView(linearLayout);
}
}
关于android - 是否可以只对应用程序的一部分使用 phonegap?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7611391/