相关疑难解决方法(0)

349
推荐指数
11
解决办法
13万
查看次数

Android模拟器无法旋转到横向

当我尝试切换模拟器的方向时,模拟器窗口旋转,模拟器屏幕的方向保持原样.任何人都可以告诉我这是什么原因?我已经尝试了StackOverflow的所有答案,似乎没有任何帮助 这是我尝试更改方向时仿真器屏幕的样子

android emulation android-emulator android-orientation

34
推荐指数
2
解决办法
2万
查看次数

横向模式在 Android Studio 模拟器中不起作用?

以下示例来自项目https://github.com/googlecodelabs/android-navigation,布局文件来自https://github.com/googlecodelabs/android-navigation/tree/master/app/src/main/资源

我在 Android Studio Emulator 中使用纵向和横向模式对其进行了测试,您可以在A1.png和A2.png 中看到结果。

横向模式似乎在 Android Studio Emulator 中不起作用。

我在真实手机上测试了相同的代码,你可以在B1.png和B2.png看到结果

横屏模式在真机上运行良好,我使用横屏模式时Android Studio Emulator有什么问题?

顺便说一句,我已经阅读了文章在 Android 模拟器中切换到横向模式

导航活动.xml

<androidx.drawerlayout.widget.DrawerLayout
    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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.android.codelabs.navigation.MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />

        <fragment
            android:id="@+id/my_nav_host_fragment"
            android:name="androidx.navigation.fragment.NavHostFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:defaultNavHost="true"
            app:navGraph="@navigation/mobile_navigation" />
    </LinearLayout>

    <com.google.android.material.navigation.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:menu="@menu/nav_drawer_menu" />

</androidx.drawerlayout.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

navigation_activity.xml?h470dp?

<LinearLayout
    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:orientation="vertical"
    tools:context="com.example.android.codelabs.navigation.MainActivity">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent" …
Run Code Online (Sandbox Code Playgroud)

java android android-emulator android-studio

4
推荐指数
1
解决办法
2554
查看次数

旋转android模拟器显示

我如何可以旋转显示仿真器(不是完整的仿真器),因为我蜂巢显示器倾斜90 Ø.

我尝试按Ctrl + F12,Num 7然后9,但完整的模拟器以纵向模式显示.我只需要倾斜显示器.

android android-emulator

2
推荐指数
1
解决办法
7165
查看次数