わいずふぁくとりいがプログラムの話題をウィキします。

<<平均をリセット

レイアウト


 アクティビティのレイアウトを、たて向きの、リニアに変更しています。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

エディットテキストのセンタリング


 エディットテキストのセンタリングは、「android:textAlignment="center"」では出来ず、「android:gravity="center_vertical|center_horizontal"」で行うようです。
 エディットテキストは、入力や、クリックを受け付けたくありません。しかし、「android:focusable="false"」にしてしまうと見にくくなるので、クリックには反応しますが、我慢することにします。

    <EditText
        android:id="@+id/editText_tempoAverage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:ems="10"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:gravity="center_vertical|center_horizontal"
        android:hint="平均" />
</LinearLayout>

メニューを出さない


 最後に、メニューは必要ないので、「onCreateOptionsMenu」をコメントにしています。

public class MainActivity extends Activity {
//	@Override
//	public boolean onCreateOptionsMenu(Menu menu) {
//		// Inflate the menu; this adds items to the action bar if it is present.
//		getMenuInflater().inflate(R.menu.main, menu);
//		return true;
//	}
}

<<終わり>>

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Menu

管理人/副管理人のみ編集できます