2014-04-05 1 views
0

안드로이드에서 설정 가시성에 문제가있는 경우 한 번 방향이 변경됩니다.한 번 화면 변경 표시 변경

한 번 인증
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:fb="http://schemas.android.com/apk/res-auto" 
android:layout_width="fill_parent" 
android:layout_height="match_parent" 
android:background="#efefef" 
android:orientation="vertical" 
tools:context=".MainActivity" > 


<ImageView 
    android:id="@+id/logo" 
    android:layout_width="fill_parent" 
    android:layout_height="300dp" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_marginTop="168dp" 
    android:src="@drawable/logo" /> 

<android.support.v4.view.ViewPager 
    android:id="@+id/pager" 
    android:layout_width="wrap_content" 
    android:layout_height="300dp" 
    android:layout_alignParentLeft="true" 
    android:layout_alignTop="@+id/logo" 
    android:background="@color/blue" 
    android:visibility="invisible" > 
</android.support.v4.view.ViewPager> 

<com.facebook.widget.LoginButton 
    android:id="@+id/facebook_login" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/logo" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="41dp" 
    fb:login_text="Connect Facebook" /> 

<ImageView 
    android:id="@+id/share" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/pager" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="25dp" 
    android:src="@drawable/fb_share" 
    android:visibility="invisible" /> 

</RelativeLayout> 

enter image description here

, 그것은 enter image description here이 페이지를 표시합니다 : 내 로그인 화면에

는이 코드를 얻었다.

하지만 난 가로 방향으로 변경하면, 로고가 표시되고 뷰 호출기가

enter image description here

안함을했다가 행방 불명이 아무것도 메신저입니까?

답변

0

매니페스트에서 해당보기의 활동에 다음 코드를 추가하십시오.

android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

+0

당신은 마술을합니다! 고마워요! – jovs

1

당신은 당신의 AndroidManifest.xml 파일에이 줄을 추가해야합니다.

android:configChanges="keyboard|keyboardHidden|orientation|screenSize" 

해당 시간에 세로 방향에서 가로 방향으로 변경할 때마다 활동이 다시 작성되며 상태도 변경됩니다. 그래서 이것을해야만합니다