我在 stackoverflow 中阅读了很多问题。但是找不到任何可能的解决方案来解决我的问题。请帮忙!这是我的 xml 文件。
<?xml version="1.0" encoding="utf-8"?>
<Relative Layout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/background_progress">
<!-- Include Action Bar -->
<include
android:id="@+id/include1"
layout="@layout/actionbarlayout" />
<!-- Include Logo -->
<include
android:id="@+id/include2"
layout="@layout/logo" ></include>
<ProgressBar
android:id="@+id/activity_splash_progress_bar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/progresstextview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/activity_splash_progress_bar"
android:layout_alignParentLeft="true"
android:layout_marginBottom="51dp"
android:layout_marginLeft="20dp"
android:shadowColor="@color/shadowcolor"
android:shadowDx="30"
android:shadowDy="8"
android:shadowRadius="5"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/mycolor"
android:textSize="20dp"
android:textStyle="bold"
android:typeface="serif" />
</RelativeLayout>
当我在我的模拟器中运行它时,它运行良好,但它没有在我的移动设备中运行并且它抛出错误。
错误是
07-04 18:51:32.437: E/AndroidRuntime(19801): FATAL EXCEPTION: main
07-04 18:51:32.437: E/AndroidRuntime(19801): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mcq.android.MCQ/com.mcq.main.ProgressbarActivity}: java.lang.RuntimeException: Binary XML file line #2: You must supply a layout_width attribute.