2013-11-14 4 views
0

ImageView를 주 활동에 추가했지만 응용 프로그램을 실행할 때 Inflate 예외가 발생하면 충돌이 발생합니다. 오류 로그에서이 활동에 대한 XML을 빌드하는 데 문제가 있음을 알 수 있습니다. 그러나 내가 알고 싶은 것은 그 활동에 무엇이 잘못 되었습니까? 전체 오류 로그는 여기에 게시됩니다 : http://pastebin.com/PAYrjHCL레이아웃에서 팽창 예외를 수정하는 방법은 무엇입니까?

오류가 발생하여 충돌하는 높이 또는 너비 설정에서 발생할 수 있다고 생각하지만 어디에서 오는지 잘 모르겠습니다. 주요 오류는 @ line 79에 강조 표시되어 있습니다. 아래 코드.

활동의 XML 레이아웃은 다음과 같이이다 : 안드로이드가 팽창 할 수 있도록하기위한

<ScrollView 
    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:fillViewport="true" 
    android:gravity="center_vertical" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context=".MainActivity" 
    > 

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" > 

<EditText 
    android:id="@+id/ductDepth" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/calc" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="37dp" 
    android:ems="10" 
    android:hint="@string/enter_duct_depth_mm" 
    android:inputType="numberDecimal" 
    android:singleLine="true" > 

    <requestFocus /> 
</EditText> 

<EditText 
    android:id="@+id/offDepth" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/textView3" 
    android:layout_alignLeft="@+id/ductDepth" 
    android:layout_marginBottom="14dp" 
    android:ems="10" 
    android:hint="@string/enter_offset_depth_mm" 
    android:inputType="numberDecimal" 
    android:singleLine="true" /> 

<EditText 
    android:id="@+id/offLength" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/textView2" 
    android:layout_alignLeft="@+id/offDepth" 
    android:layout_marginBottom="20dp" 
    android:ems="10" 
    android:hint="@string/enter_offset_length_mm" 
    android:inputType="numberDecimal" 
    android:singleLine="true" /> 

<TextView 
    android:id="@+id/textView2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/offDepth" 
    android:layout_alignLeft="@+id/offDepth" 
    android:text="Depth:" 
    android:textSize="30sp" /> 

<TextView 
    android:id="@+id/textView3" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/ductDepth" 
    android:layout_alignLeft="@+id/ductDepth" 
    android:text="Duct Depth:" 
    android:textSize="30sp" /> 

<TextView //line 79! 
    android:id="@+id/textView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/offLength" 
    android:layout_alignLeft="@+id/offLength" 
    android:text="Length:" 
    android:textColor="@style/AppTheme" 
    android:textSize="30sp" /> 

<Button 
    android:id="@+id/calc" 
    android:layout_width="200dp" 
    android:layout_height="70dp" 
    android:layout_alignLeft="@+id/ductDepth" 
    android:layout_alignParentBottom="true" 
    android:layout_marginBottom="30dp" 
    android:background="@drawable/calcbttrans" /> 



<android.support.v4.view.ViewPager  
android:id="@+id/pager" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_below="@id/calc" > 

<!-- 
This title strip will display the currently visible page title, as well as the page 
titles for adjacent pages. 
--> 

<android.support.v4.view.PagerTitleStrip 
    android:id="@+id/pager_title_strip" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="top" 
    android:background="#33b5e5" 
    android:paddingBottom="4dp" 
    android:paddingTop="4dp" 
    android:textColor="#fff" /> 

</android.support.v4.view.ViewPager> 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="700dp" 
    android:layout_above="@+id/textView1" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="84dp" 
    android:src="@drawable/mark3" /> 

</RelativeLayout> 

</ScrollView> 

답변

1

android:textColor 속성 만 @color 또는 16 진수 값을 전달해야합니다. 스타일을 전달하면 작동하지 않습니다. 여기

+0

, 천재 :) –

0

문제

android:textColor="@style/AppTheme" 

에 의해 발생 : android.content.res.Resources $ NotFoundException : 자원이 ColorStateList (컬러 또는 경로)되지 않습니다 : 그것을 고정

+0

나는 당신이 보여주는 문제는 무엇입니까 이해가 안 돼요? 정교하게하십시오. –

+0

미안 misplaced.have 게시물을 업데이 트했습니다. – Subbu