2012-04-10 3 views
1

호기심 문제가 있습니다. 내 Android 애플리케이션은 내 휴대 전화 (Android 버전 2.3.5, API 9), 일부 에뮬레이터 (Android 버전> 2.2, API> = 8, API 8, 13, 15에서 테스트 됨)에서 작동하며 다른 에뮬레이터 (Android 버전 < 2.2, API < 8, API 4, 7에서 테스트 됨). 응용 프로그램은 에뮬레이터에서 API < 8로 크래시하지 않지만 내 사용자 정의 이미지 뷰 중 일부는 화면에 나타나지 않습니다. 그렇지 않으면 모든 것이 제대로 작동합니다.API 7 이하 버전에서 앱을 실행할 때 맞춤 이미지 뷰가 누락되었습니다.

은 내가하지 API < 8에서 지원하는 모든 방법을 사용하는 경우 식별 도구 보풀의 최신 버전을 사용했지만, 내가 확인한 유일한 것은 내가 API 4, 오류가 필요하지 않습니다 하나의 방법을 사용하는 것이있다 android : targetSdkVersion = 4로 설정하고 대상을 4로 빌드 할 때 API에 대한 메시지가 표시됩니다.

API 7과 8 사이에 오류가 발생하지만 아무 것도 찾을 수 없으므로 here도 보았습니다. 또한 사용자 정의 ImageView의 모든 메소드를 개발자 문서와 비교하여 API> 7이 필요한 메소드가 있는지 확인했습니다.

다른 문제가있는 사람이 있습니까?

편집 :

여기 내 주요 XML 파일입니다

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    android:id="@+id/gameLayoutID" 
    > 

<fragment 
    android:id="@+id/groundMenuID" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    class="com.foo.bar.someClass"/> 

<fragment 
    android:id="@+id/topLeftMenuID" 
    android:layout_width="@dimen/TopLeftRightMenu_width" 
    android:layout_height="@dimen/TopMenu_height" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentLeft="true" 
    class="com.foo.bar.someClass"/> 

<fragment 
    android:id="@+id/topRightMenuID" 
    android:layout_width="@dimen/TopLeftRightMenu_width" 
    android:layout_height="@dimen/TopMenu_height" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentRight="true" 
    class="com.foo.bar.someClass"/> 

<fragment 
    android:id="@+id/leftMenuID" 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 
    android:layout_alignParentLeft="true" 
    android:layout_above="@id/groundMenuID" 
    android:layout_below="@id/topLeftMenuID" 
    class="com.foo.bar.someClass"/> 

<fragment 
    android:id="@+id/rightMenuID" 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 
    android:layout_alignParentRight="true" 
    android:layout_above="@id/groundMenuID" 
    android:layout_below="@id/topRightMenuID" 
    class="com.foo.bar.someClass"/> 

<fragment 
    android:id="@+id/topMenuID" 
    android:layout_width="fill_parent" 
    android:layout_height="@dimen/TopMenu_height" 
    android:layout_alignParentTop="true" 
    android:layout_toRightOf="@id/topLeftMenuID" 
    android:layout_toLeftOf="@id/topRightMenuID" 
    class="com.foo.bar.someClass"/> 

<com.foo.bar.CustomImageViewLayout 
    android:id="@+id/wheelMenuID" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_toRightOf="@id/leftMenuID" 
    android:layout_toLeftOf="@id/rightMenuID" 
    android:layout_below="@id/topMenuID" 
    android:layout_above="@id/groundMenuID"/> 

<fragment 
    android:id="@+id/figurePassageID" 
    android:layout_width="fill_parent" 
    android:layout_height="@dimen/figurePassage_height" 
    android:layout_above="@id/groundMenuID" 
    class="com.foo.bar.someClass"/> 


</RelativeLayout> 

파편 표준 조각 클래스 'onCreateView 방법을 통해 팽창하고 그들이 잘 상관없이 API를 작동합니다. 커스텀 ImageView 클래스에 관해서는 ... 코드가 많아서 공개적으로 붙여 넣기를 원한다면 잘 모릅니다 (내 주요 지적 재산권). 나는 거기에 오류가 없다고 확신하지만 다시 검증 할 것이다. 그렇지 않으면 몇 가지 코드를 붙여 넣으려고합니다.

+0

아마도 코드를 게시하면 도움이 될 것입니다 :) (문제가 발생한 xml보기 및 사용자 정의 이미지보기). – YuviDroid

+0

@YuviDroid : XML 파일로 업데이트했습니다. 파편이 잘 작동합니다. 오류는 CustomImageViewLayout (확장 된 RelativeLayout) 클래스 또는 사용자 정의 ImageView 자체에있을 가능성이 높습니다. –

답변

0

match_parent의 사용을 모두 fill_parent으로 변경해보십시오.

+0

좋은 제안, 고마워. 불행히도 나는 이미 그러한 변화를 가져 오지 않았습니다. 수정 :이 제안은 fill_parent가 match_parent에서 API 7로 변경 되었기 때문에 발생합니다. [참조] (http://developer.android.com/sdk/android-2.2.html) –

관련 문제