Closed Ramblerchris closed 1 year ago
华为meta30pro
鸿蒙2.0.0
7.0.0
2.0.1
继承QMUIFragment后 ,组合控件中包含EditText 时,跳转startfragment 回来,EditText中显示文本消失,非组合控件没问题。 直接继承fragment 或在activity中没问题 代码如下:
public class TestView extends FrameLayout { public TestView(@NonNull Context context) { super(context); init(context, null); } public TestView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); init(context, attrs); } public TestView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } private void init(Context context, AttributeSet attrs) { LayoutInflater.from(context).inflate(R.layout.item_dash_testedit, this, true); } }
item_dash_testedit 布局:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/et_input" android:layout_width="match_parent" android:layout_height="40dp" /> </LinearLayout>
运行环境
华为meta30pro
鸿蒙2.0.0
7.0.0
2.0.1
具体问题描述
继承QMUIFragment后 ,组合控件中包含EditText 时,跳转startfragment 回来,EditText中显示文本消失,非组合控件没问题。 直接继承fragment 或在activity中没问题 代码如下:
item_dash_testedit 布局:
异常日志(堆栈)