0
我有一個活動在風景模式下設置,因爲我正在設置從相機拍攝的圖片。問題是我想在頂部放一個按鈕這項活動是爲了將圖片上傳到網站。在風景模式下放置一個按鈕活動
這裏是一段相關代碼:
public void onCreate(Bundle icicle) {
super.onCreate(icicle);requestWindowFeature(Window.FEATURE_NO_TITLE);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
....
}
,這裏是我的xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/uploadBtn"
android:text="Upload picture"
/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:id="@+id/myPic"
/>
</LinearLayout>
這裏是結果:
http://i55.tinypic.com/10h4xzr.png
現在我希望按鈕位於屏幕的頂部,而不是在右側!我該怎麼辦?