繁体   English   中英

我在 Android Studio 中切换时遇到问题

[英]I have a problem with switch in Android Studio

我编写了应用程序设计的代码,但是当我在应用程序设计上添加开关时,它一直向我显示“替换‘开关’小部件的使用”。 我不确定有什么问题,这是我第一次使用 Android Studio

<Switch
    android:id="@+id/sw_compact"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginTop="24dp"
    android:layout_marginEnd="8dp"
    android:layout_marginRight="8dp"
    android:text="@string/activecustomer"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.502"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/editTextNumber" />

这是我的问题

在此处输入图片说明

在此处输入图片说明

没什么好担心的。 这只是一个警告,因为您正在使用 AppCompatActivity。 它支持材料设计和动画。 我们可以说这比经典的“Switch”更优雅。 迁移到“SwitchCompat”是安全的,因为它包含更多功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM