【发布时间】:2020-10-16 12:35:39
【问题描述】:
我有一个按钮,我想给它 %20 的不透明度。点击后它必须是旧颜色,没有不透明度或透明度。
这是我的 XML:
<com.example.android.custombutton.CustomButton
android:id="@+id/custombutton_cardselection_turkish_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/blue_button"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:text="@string/nfc_new_turkish_id"
android:textColor="@color/white"
app:layout_constraintBottom_toTopOf="@+id/custombutton_cardselection_passport"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/guideline_cardselection_top" />
我想在 XML 中更改它,而不是在 kotlin 部分。我该怎么做?
【问题讨论】: