안녕하세요 저는 단일 레이아웃에서 두 조각을 만들었습니다.안드로이드의 세로 모드와 가로 모드의 다른 디자인
레이아웃 - 랜드에서 :
조각을 수평으로 표시해야합니다.
레이아웃 포트 : 조각을 세로로 표시해야합니다.
이제 세로 모드에서 앱을 실행하면 조각을 세로로 표시한다는 의미입니다. 이제 가로 모드로 회전해야만 조각이 세로로 만 표시됩니다.
가로 모드에서 응용 프로그램을 실행해야 함은 가로로 조각을 표시한다는 의미입니다. 세로 모드로 회전하면 가로로 조각을 표시한다는 의미입니다. 수직 조각을 표시하는 의미 난 세로 모드에서 응용 프로그램을 실행해야
:
는하지만 난 출력처럼 표시하고 싶습니다. 이제 가로 모드로 회전해야만 조각이 가로로 표시됩니다.
동시에 가로 모드에서 앱을 실행해야 함은 가로로 조각을 표시하는 것을 의미합니다. 세로 모드로 회전해야 함으로 세로로 조각을 표시해야합니다.
어떻게 할 수 있습니까 ???
위와 같은 결과가 나타나는 이유는 무엇입니까? 제게 제안 해주세요.
편집 :
레이아웃 - 토지 : fragment.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/_listDetails"
>
<ImageView
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@+id/pos"
android:src="@drawable/ref_off" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/layout"
android:background="#414042"
android:orientation="horizontal" >
<fragment
android:id="@+id/activity_main"
android:name="com.notch.notchbolly.MainActivity"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.83"
/>
<View
android:layout_width="2dp"
android:layout_height="fill_parent"
android:background="#FFFFFF"
/>
<fragment
android:id="@+id/subcate"
android:name="com.notch.notchbolly.SubCate"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
레이아웃 포트 : fragment.xml : 이것은 내 AndroidListFragmentActivity이
<?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/_listDetails"
>
<ImageView
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@+id/pos"
android:src="@drawable/ref_off" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/layout"
android:background="#414042"
android:id="@+id/orien"
android:orientation="vertical"
>
<fragment
android:id="@+id/activity_main"
android:name="com.notch.notchbolly.MainActivity"
android:layout_width="fill_parent"
android:layout_height="200dp"
/>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="#FF0000"
/>
<fragment
android:id="@+id/subcate"
android:name="com.notch.notchbolly.SubCate"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
</RelativeLayout>
입니다 :
public class AndroidListFragmentActivity extends FragmentActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment);
ImageView refresh = (ImageView) findViewById(R.id.refresh);
refresh.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent in = new Intent(AndroidListFragmentActivity.this, AndroidListFragmentActivity.class);
startActivity(in);
}
});
}
@Override
public void onConfigurationChanged (Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
}
}
https://www.youtube.com/watch?v=3FMn4FEv12M이 동영상 확인 – TheFlash