关于膨胀例外

时间:2013-06-10 11:37:50

标签: android inflate-exception

这是下面的xml文件,因为它有异常。在这里,滚动textview有一些问题因为它给了inflator异常。请帮助我。我认为代码中的问题依赖于com.sevya.alertman .ScrollingTextView.please只需检查以下xml文件并告诉我解决方案

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        <LinearLayout 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:background="#cdcdcd" 
            android:orientation="vertical">

            <LinearLayout 
                android:layout_width="match_parent" 
                android:layout_height="match_parent" 
                android:orientation="vertical">

                <!-- Volume -->

                <LinearLayout 
                    android:layout_width="match_parent" 
                    android:layout_height="60dp" 
                    android:background="@drawable/background" 
                    android:clickable="false" 
                    android:orientation="vertical" 
                    android:weightSum="10">

                <LinearLayout 
                    android:layout_width="match_parent" 
                    android:layout_height="0dp" 
                    android:layout_weight="5" 
                    android:orientation="horizontal" 
                    android:weightSum="10">

                    <TextView 
                        android:layout_width="0dp" 
                        android:layout_height="match_parent" 
                        android:layout_weight="7.5" 
                        android:gravity="bottom" 
                        android:paddingLeft="10dp" 
                        android:text="Default Volume" 
                        android:textAppearance="@android:style/TextAppearance.Large" 
                        android:textColor="#2E2E2E" 
                        android:textSize="19dp"/>

                    <TextView 
                        android:id="@+id/textview_volume_settings" 
                        android:layout_width="wrap_content" 
                        android:layout_height="wrap_content" 
                        android:layout_weight="2.5" 
                        android:gravity="center_horizontal|center_vertical" 
                        android:text=""/>

                </LinearLayout>

                <RelativeLayout
                     android:layout_width="match_parent" 
                     android:layout_height="0dp" 
                     android:layout_weight="5">

                    <SeekBar 
                        android:id="@+id/seekbar_volume_settings" 
                        android:layout_width="fill_parent" 
                        android:layout_height="wrap_content" 
                        android:layout_alignParentLeft="true" 
                        android:layout_alignParentTop="true" 
                        android:max="100" 
                        android:maxHeight="9dp" 
                        android:paddingLeft="10dp" 
                        android:paddingRight="10dp" 
                        android:progressDrawable="@drawable/progress" 
                        android:thumb="@xml/thumb_style"/>

                </RelativeLayout>


                </LinearLayout>

                <View 
                    android:layout_width="match_parent" 
                    android:layout_height="1dp" 
                    android:background="#000000"/>


                <!-- Ringtone -->

                <LinearLayout 
                    android:id="@+id/linearlayout_ringtone_settings" 
                    android:layout_width="match_parent" 
                    android:layout_height="60dp" 
                    android:background="@drawable/background" 
                    android:clickable="true" 
                    android:orientation="horizontal" 
                    android:weightSum="10">

                <LinearLayout 
                    android:layout_width="0dp" 
                    android:layout_height="60dp" 
                    android:layout_weight="7.5" 
                    android:orientation="vertical" 
                    android:weightSum="10">

                    <TextView 
                        android:layout_width="match_parent" 
                        android:layout_height="match_parent" 
                        android:layout_weight="5" 
                        android:gravity="bottom" 
                        android:paddingLeft="10dp" 
                        android:text="Default Ringtone" 
                        android:textAppearance="@android:style/TextAppearance.Large" 
                        android:textColor="#2E2E2E" 
                        android:textSize="19dp"/>

                   <com.sevya.alertman.ScrollingTextView 
                       android:id="@+id/textview_ringtone_settings" 
                       android:layout_width="match_parent" 
                       android:layout_height="match_parent" 
                       android:layout_weight="5" 
                       android:ellipsize="marquee" 
                       android:fadingEdge="horizontal" 
                       android:gravity="top" 
                       android:lines="1" 
                       android:marqueeRepeatLimit="marquee_forever" 
                       android:paddingLeft="10dp" 
                       android:scrollHorizontally="true" 
                       android:text="@string/defaultringtone" 
                       android:textAppearance="@android:style/TextAppearance.Small" 
                       android:textColor="#2E2E2E"/>

                </LinearLayout>

                <RelativeLayout 
                    android:layout_width="0dp" 
                    android:layout_height="match_parent" 
                    android:layout_weight="2.5" 
                    android:gravity="center">

                    <ImageView 
                        android:layout_width="wrap_content" 
                        android:layout_height="40dp" 
                        android:contentDescription="@string/downarrow" 
                        android:gravity="center_horizontal|center_vertical" 
                        android:src="@android:drawable/ic_menu_more"/>

                </RelativeLayout>

                </LinearLayout>

                <View 
                    android:layout_width="match_parent" 
                    android:layout_height="1dp" 
                    android:background="#000000"/>
            </LinearLayout>

            </LinearLayout>


    </LinearLayout>

当我运行代码时,我收到以下错误。你能告诉我怎样才能消除这些异常:

06-03 08:37:40.161: E/ERROR(9515): android.view.InflateException: Binary XML file line #125: Error inflating class com.sevya.alertman.ScrollingTextView

这是我运行程序时遇到的错误。

0 个答案:

没有答案