【发布时间】:2013-12-12 11:36:06
【问题描述】:
我正在编写一个相机应用程序,我想在用户以纵向视图查看应用程序时在底部显示按钮,并希望在使用横向视图时显示到右侧
但在我的应用程序中,我仍然在两个视图(纵向和横向)中获得右侧按钮
activity_camera.xml:-
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/splash_background" >
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/btnView" />
<TextView
android:id="@+id/angel_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="18dp"
android:layout_toRightOf="@+id/camera_preview"
android:maxLines="1"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/btnView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:background="@drawable/gallery" />
<Button
android:id="@+id/btnCapture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/camera_preview"
android:background="@drawable/capture" />
</RelativeLayout>
【问题讨论】:
标签: android android-layout android-camera