Androidのアップグレード後にメーカー3.5、素晴らしい出会いの問題レイアウトxmlファイルにコードをフォーマットした後、コントロールの順序が変更され、それは私たちが望む結果ではないですが、オンライン検索では、私は本当に、ポットAS3.5ました各アップグレードは調整が行われ、なぜ勉強する時間を持って、それについての最初のレコードをさまざまな問題が発生します。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:padding="16dp"
tools:context="sun.geoffery.mvpdemo.MainActivity">
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="点击按钮获取网络数据" />
<Button
android:id="@+id/getData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【成功】" />
<Button
android:id="@+id/getDataForFailure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【失败】" />
<Button
android:id="@+id/getDataForError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【异常】" />
</LinearLayout>
シンプルなレイアウトインタフェースは、一般的に次の:
あなたは、Ctrl + Shiftキー+ F、我々のコードのフォーマット、見に行きます:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:padding="16dp"
tools:context="sun.geoffery.mvpdemo.MainActivity">
<Button
android:id="@+id/getData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【成功】" />
<Button
android:id="@+id/getDataForFailure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【失败】" />
<Button
android:id="@+id/getDataForError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取数据【异常】" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="点击按钮获取网络数据" />
</LinearLayout>
TextViewの最上位原稿は次のように顔無知インタフェースを強制、下にフォーマットされる:
次のように特定の溶液です。
- 設定 - > Editorの>コードSTYLE-> XML
- 右上の設定from->定義済みのスタイルをクリックして、パーフェクトを保存するには、Android [OK]をクリックします]を選択!
その後、私たちが何をしたいの効果をコードのフォーマット