レイアウトの変更とレイアウトのTextは連動している(というか同一のモノ)なので
レイアウトを変更するとレイアウトのTextは変更されますが、
レイアウトを変更したからと言って、javaのclassとかを記述している所は変更されません。
例えばですが
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="追加"
android:textSize="18sp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="戻る"
android:textSize="18sp"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
上記のコードの中の android:id="@+id/back_button" と定義されているボタンの記述を
消したからと言って MainActivity.java の id/back_buttonn に関する処理は削除されません。
同様に追記したからと言って処理が追加される訳でもありません。
不要になったコードは自分でコメントアウトするか削除する、
必要になったコードは自分で追記する必要があります。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/24 06:22
2017/07/25 01:17 編集