Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/206.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android Emulator中正确模拟我的化石(WearOS)手表?_Android_Android Emulator_Wear Os_Android Wear 2.0 - Fatal编程技术网

如何在Android Emulator中正确模拟我的化石(WearOS)手表?

如何在Android Emulator中正确模拟我的化石(WearOS)手表?,android,android-emulator,wear-os,android-wear-2.0,Android,Android Emulator,Wear Os,Android Wear 2.0,我试图为Android智能手表(Android Wear)开发一个应用程序,特别是化石运动手表 在Android设备管理器中,我将基本设备设置为Android Wear Round Chin,分辨率设置为320x320 运行我的代码时,仿真器看起来像: 但是,当部署到手表时,它看起来是这样的: 请忽略实际文本,因为数字是随机的。但是,为什么会在实际手表上裁剪圆圈 还有其他一些细微的区别,比如在emulator中出现在一行上的文本有时跨越两行。如何模拟手表表面的实际大小,因为我目前必须部署到手

我试图为Android智能手表(Android Wear)开发一个应用程序,特别是化石运动手表

在Android设备管理器中,我将基本设备设置为Android Wear Round Chin,分辨率设置为320x320

运行我的代码时,仿真器看起来像:

但是,当部署到手表时,它看起来是这样的:

请忽略实际文本,因为数字是随机的。但是,为什么会在实际手表上裁剪圆圈

还有其他一些细微的区别,比如在emulator中出现在一行上的文本有时跨越两行。如何模拟手表表面的实际大小,因为我目前必须部署到手表上,并直接在手表上进行测试

代码:


...
...
...

只需移除
BoxInsetLayout
包装器,并设置内部视图的适当大小即可

BoxInsetLayout
layout将内部视图缩放为内接矩形,以确保视图不会被屏幕截取。但与此同时,您的可用空间将减少。在这种情况下,没有足够的空间显示进度条

因为模拟器有足够的空间,所以内部视图可以完全显示

备选方案:您似乎使用了自定义视图,请尝试对其进行修改以减少最小空间需求。这样你的进度条就可以放进缩小的空间

<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/box_inset_layout_padding"
    tools:deviceIds="wear">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center" 
        android:padding="@dimen/inner_frame_layout_padding"
        app:boxedEdges="all">
            ...
            ...
            ...
    </FrameLayout>
</android.support.wear.widget.BoxInsetLayout>