Hippy icon indicating copy to clipboard operation
Hippy copied to clipboard

HippyRootView 自适应

Open ya0xu opened this issue 1 year ago • 0 comments

Android 代码:

<androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true">

    <LinearLayout
        android:id="@+id/ll1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        
        <HippyView
            android:id="@+id/hv1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <HippyView
            android:id="@+id/hv2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

</androidx.core.widget.NestedScrollView>

hippy 版本:2.17.2

hippy 代码 vue-next

HippyView 继承自LinearLayoutCompat,在调用hippyRootView = hippyEngine.loadModule后,把hippyRootView添加HippView里面。 此时只显出来一个HippyView,占满了父容器的高度。没有实现自适应。 hv1、hv2设置固定高度则都可以显示 。

iOS通过sizeFlexiblity、rootViewDidChangeIntrinsicSize,使用同一套hippy代码,可以自适应,安卓怎样实现自适应呢?

ya0xu avatar May 22 '24 11:05 ya0xu