【发布时间】:2025-12-28 04:50:12
【问题描述】:
我最近开始使用 Android Studio,因为我想为我的 Android 设备创建一个应用。
我选择底部导航活动作为模板并添加了一个微调器。我将微调器放在页面标题下的最高位置,但是当我在 Android 10 手机上通过调试启动应用程序时,微调器和页面标题之间有很大的空白。但是预览中没有。
如果重要的话,我有一个小米红米 Note 8T Global。
我的片段代码:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".ui.myfragment.MyFragment"
tools:layout_editor_absoluteY="81dp">
<Spinner
android:id="@+id/myspinner"
android:layout_width="391dp"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:spinnerMode="dropdown"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
在 android studio 中预览
应用中的外观
提前致谢
【问题讨论】:
标签: android android-studio spinner