亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

android.view.inflateException: 二進制 XML 文件行 #99:

android.view.inflateException: 二進制 XML 文件行 #99:

Cats萌萌 2022-08-17 12:12:33
我正在嘗試在我的 xml 文件中添加進度條。一旦用戶在三個字段中輸入數據并單擊“提交”按鈕,就會顯示此進度條,然后啟動新的活動。這是 Logcat 主錯誤行無法啟動活動 ComponentInfo{com.example.hadithapp/com.example.hadithapp.AddHadithDetailActivity}: android.view.InflateException: Binary XML file line #99: Binary XML file line #99: error inflating class android.widget.ProgressBar下面是進度條 xml 代碼<ProgressBar    android:id="@+id/interminate_progress_bar"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:indeterminate="true"    android:visibility="visible"    android:theme="@style/ProgressBarTheme"    app:layout_constraintStart_toStartOf="parent"    app:layout_constraintEnd_toEndOf="parent"    app:layout_constraintTop_toTopOf="parent"    app:layout_constraintBottom_toBottomOf="parent"/>下面是樣式 xml 代碼<style name="ProgressBarTheme">    <item name="android:backgroundTint">@drawable/progress_bar_bg</item>    <item name="android:background">@drawable/progress_bar_bg</item></style>這是@drawable/progress_bar_bg代碼<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><corners android:radius="360dp"/><solid android:color="@color/colorPrimary"/></shape>我不知道是什么原因導致錯誤。但是,當我刪除progress_bar xml 代碼中的主題行時,ERROR 被刪除了。我仍然不明白為什么進度條主題不起作用。
查看完整描述

2 回答

?
HUX布斯

TA貢獻1876條經驗 獲得超6個贊

當我刪除行android:theme=“@style/ProgressBarTheme”時,錯誤消失了。

但是我想像upwork一樣獲得具有圓形背景的進度條。我通過添加mProgressbar.setBackground(getDrawable(R.drawable.progress_bar_bg))得到了它;以編程方式的代碼行。:)


查看完整回答
反對 回復 2022-08-17
?
墨色風雨

TA貢獻1853條經驗 獲得超6個贊

更改為android:theme="@style/ProgressBarTheme"style="@style/ProgressBarTheme"



查看完整回答
反對 回復 2022-08-17
  • 2 回答
  • 0 關注
  • 103 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號