我已經在stackoverflow中讀了很多問題,但找不到任何可能的解決方案,請幫忙! 這是我的xml文件。#2的BINARY 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.
ok..let我查一下。 – Chiradeep
您的解決方案工作。謝謝很多..是的,它在模擬器中完美地工作。我自己不知道原因.Neway,感謝您的幫助。使用'match_parent'的 – Chiradeep