android:background="?android:selectableItemBackground" is not highlighting the whole item.
問題截圖
<?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="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:background="?android:selectableItemBackground"
android:focusable="true">
<com.google.android.material.imageview.ShapeableImageView
some code/>
<TextView
some code />
</androidx.constraintlayout.widget.ConstraintLayout>
即使我將可聚焦和可點擊設定為真,我仍然很困惑為什么會發生這種情況。
uj5u.com熱心網友回復:
試著改變你的寬度ConstrainLayout來match_parent
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/406223.html
標籤:
下一篇:Kotlin,實作擴展var屬性
