Steps to Reproduce
1、把example下的NativeView里面的TextView换成fragment 会报错,在构造方法中加入:
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (View) inflater.inflate(R.layout.ih_activity_test, null, true);
2、ih_activity_test中的内容:
<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/android "
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
<fragment
android:id="@+id/fragment"
android:name="com.idlefish.flutterboost.example.tab.NativeFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
3、getView的return改为view
@nonnull
@OverRide
public View getView() {
return view;
}
4、报错内容为:
Unhandled Exception: PlatformException(error, Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Error inflating class fragment, null, android.view.InflateException: Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Binary XML file line #7 in com.idlefish.flutterboost
纠结了一周,麻烦请看看
1条答案
按热度按时间k2arahey1#
对了,如果新建一个没有引入flutterboost的demo,在plateformview中引入fragment是没问题的