Closed luckyjay09 closed 3 years ago
MainActivity
实现 AbstractWeexActivity,
在 MainActivity
中使用 FragmentTabHost 实现导航,
加载到 Fragment 中渲染:
MainActivity mainActivity = (MainActivity) getActivity();
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
mainActivity.setContainer(customView);
return customView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mainActivity.renderPage(WXFileUtils.loadAsset("more-lists.js", getContext()));
}
😁
AbstractWeexActivity不是抽象类吗 为什么是实现它? 楼上有没有完整点的代码 我撸不出来啊 直接用用最普通的V4包的Fragment通过按钮replace()方法 切换不同的fragment可以实现吗 还有customView是哪里来的
Activity
集成 AbstractWeexActivity
就好了,AbstractWeexActivity 虽然是抽象类,但没有抽象方法,不需要做额外处理;
customView 只需是 ViewGroup
子类即可;
你看一遍官方 AbstractWeexActivity
类的代码就会懂了。
🙂
同问 现在如何将Weex渲染加载到当前Activity的Fragment中
一样我也想问,怎么把 js 渲染到fragment里 求大神啊
Hi guys, try this demo weex-start-kit to see how to load weex page in Fragment(Android)
This PR/issue doesn't received response since Weex migrated to Apache two years ago and this repository is no longer active yet.
Feel free to ask question in new repository and thanks for your contribution.
This issue is outdated for a long time and will be closed now. You can create a new one if you still have questions.
这个问题是否解决了,目前也遇到此类问题,参考[weex-start-kit]无法解决,是否可以给与一些帮助
Android使用原生导航栏 怎么让Weex渲染加载到当前Activity的Fragment中 官方只有Activity的Weex实现