[英]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.