首页»版块 MagicOS MagicOS 在荣耀x40(magicos7.0, android13)上使用ScrollView ...
#荣耀MagicOS#

在荣耀x40(magicos7.0, android13)上使用ScrollView标签包裹SurfaceView会显示黑屏

[复制帖子标题和链接]

4112

荣耀粉丝256086110  LV1  发表于 2023-8-4 12:42:08 江苏 来自:浏览器
那个我是做android开发的,现在在荣耀x40(magicos7.0, android13)上使用ScrollView标签包裹SurfaceView会显示黑屏,其它手机没有问题,我贴一下代码,
<HorizontalScrollView
android:layout_width=”match_parent”
android:layout_height=”0dp”
app:layout_constraintVertical_weight=”1”
android:layout_marginBottom=”@dimen/gdp_5”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toBottomOf=”@+id/topLayout”
app:layout_constraintBottom_toTopOf=”@+id/rippleView”
android:scrollbars=”horizontal”
android:scrollbarSize=”@dimen/gdp_5”>
    <RelativeLayout
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”>
        <view.SetupSolarLayout
android:id=”@+id/setupSolarLayout”
android:layout_width=”4000dp”
android:layout_height=”3500dp”
android:layout_alignParentTop=”true”
android:layout_alignParentStart=”true”/>
    </RelativeLayout>
</HorizontalScrollView>


SetupSolarLayout是自定义的类继承SurfaceView,问题包裹上HorizontalScrollView标签就黑屏。好像是HorizontalScrollView把它遮挡了,因为退到后台是能看见SurfaceView的内容的,然后放到前台就是黑屏,锁屏后再解锁也能看见一下,立马又被遮挡成黑屏,黑屏状态下SurfaceView还是能操作的,只是看不见。想问一下,这是什么情况,要怎么改?
评论2
荣耀粉丝254139651 荣耀答答团  发表于 2023-8-4 14:08 属地未知 来自:PC-VOC

您好~为了更好的协助您处理您的问题,还请您查看一下私信~
荣耀粉丝245839407  LV7  发表于 2023-8-4 15:32 贵州 来自:荣耀 Magic3 Pro 5G
我这边建议换手机
您需要登录后才可以评论 登录 | 立即注册
简体中文 - China
快速回复 返回顶部 返回列表