私は次のxmlビューを持っています
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@color/black_overlay"
>
<TextView
android:id="@+id/TITLE"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ver 0.0.1"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/new_game"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="@string/newGame" />
<Button
android:id="@+id/LoadGame"
android:layout_width="wrap_content"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:text="@string/loadGame" />
<Button
android:id="@+id/quit_game"
android:layout_width="wrap_content"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:text="@string/exitGame" />
</LinearLayout>
そして、この xml ビューを表示するメイン メニュー クラス:
public class Main_Menu extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
this.setContentView(R.layout.menu);
}
}
正しく表示されると次のようになります: (OS 2.3.4 を実行している lg g2x を使用)
OS 4.1.2 を実行している Galaxy S 3 でテストしたところ、次のようになりました。
何が起こっているのかわかりません...
どんな助けでも大歓迎です!
ありがとう!