巴斯賓 | 完整的xml檔案
xml 元素
<EditText
android:id="@ id/etBaseAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:ems="8"
android:hint="Bill amount"
android:inputType="numberDecimal"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="@ id/tvBaseLabel"
app:layout_constraintStart_toEndOf="@ id/tvBaseLabel"
app:layout_constraintTop_toTopOf="@ id/tvBaseLabel" />
日志
有人可以說我做錯了什么嗎?
我使用 Android 11
uj5u.com熱心網友回復:
洗掉 (android:id=@ id/etBaseAmount") 的父約束布局(第 5 行),您兩次給出了相同的 id
uj5u.com熱心網友回復:
你能附上完整的xml嗎,看起來你缺少一個父標簽
uj5u.com熱心網友回復:
我實際上隨機找到了解決方案:問題是由于未知原因,該元素在檔案 xD 中出現了兩次
uj5u.com熱心網友回復:
在您提供的 xml 鏈接中,我可以看到您為父約束布局(第 5 行)和 EditText(第 55 行)使用了相同的 id( android:id=@ id/etBaseAmount") ,更改父布局的id,它會正常作業。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/521259.html
