android.widget.ProgressBar无法强制转换为android.widget.LinearLayout

android.widget.ProgressBar无法强制转换为android.widget.LinearLayout,第1张

概述GIVEN<RelativeLayoutxmlns:android="http://schemas.android.com/apkes/android"xmlns:tools="http://schemas.android.comools"android:layout_width="fill_parent"android:layout_height="fill_parent"

GIVEN

<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:tools="http://schemas.androID.com/tools"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:paddingBottom="@dimen/activity_vertical_margin"    androID:padding@R_419_6823@="@dimen/activity_horizontal_margin"    androID:paddingRight="@dimen/activity_horizontal_margin"    androID:paddingtop="@dimen/activity_vertical_margin"    tools:context=".InBoxActivity" >    <!-- refresh button -->    <button        androID:ID="@+ID/button_refresh_inBox"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:layout_alignParent@R_419_6823@="true"        androID:layout_alignParenttop="true"        androID:onClick="refreshInBox"        androID:text="@string/refresh_inBox" />    <linearLayout        androID:ID="@+ID/inBox_container"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:layout_below="@ID/button_refresh_inBox" >        <Progressbar            androID:ID="@+ID/inBox_prog_bar"                        androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content" />    </linearLayout>    <TextVIEw        androID:ID="@+ID/empty_inBox"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:layout_below="@ID/inBox_container"        androID:textIsSelectable="false" /></relativeLayout>

结果:

当我运行应用程序时,我收到错误

E/AndroIDRuntime(930): java.lang.classCastException: androID.Widget.Progressbarcannot be cast to androID.Widget.linearLayout

有谁知道如何解决这一问题?

目的:

收件箱正在加载时显示进度条;然后让收件箱内容填充线性布局.

背景:

一切都很好.我只是认为在加载收件箱时有一个进度条而不是空白屏幕会更好.添加进度条会导致错误. (我真的想在布局文件中指定进度条,而不是以编程方式).

解决方法:

刷新和项目>清理你的项目.

这与自动生成R引用时所做的一些混乱有关,当清理它时将创建一个具有正确ID引用的新的引用.

总结

以上是内存溢出为你收集整理的android.widget.ProgressBar无法强制转换为android.widget.LinearLayout全部内容,希望文章能够帮你解决android.widget.ProgressBar无法强制转换为android.widget.LinearLayout所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1116010.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存