8.2.5activity_main.xmlの内容をチェックする
では、activity_main.xmlにどのようなコードが記述されているのか、「activity_main.xml」タブをクリックしてテキスト・エディタに切り替えて、内容を確認してみましょう。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
ざっとこのようなソースコードが記述されているはずです。これが、Androidのレイアウトの内容なのです。これは整理すると、以下のようになっています。
<RelativeLayout>
この記事は会員限定です。会員登録をすると続きをお読みいただけます。
ログイン / 新規登録