liguofeng29’s blog

個人勉強用ブログだっす。

┗━UI

AndroidのUI - ToggleButtonとSwitch

activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> </linearlayout>

AndroidのUI - CheckBoxとRadioButton

activity_main.xml <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TableRow> </tablerow></tablelayout>

AndroidのUI - Button

editText.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> </linearlayout>

AndroidのUI - EditText

editText.xml <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="1"> <TableRow> </tablerow></tablelayout>

AndroidのUI - TextView

textView.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="5dp"> </linearlayout>

AndroidのUI - 単位

単位説明 px(ピクセル) ディスプレイの点 dip(dp)(device independent pixels) 1インチ160点のディスプレイの場合、1dip = 1px sp(scaled pixels, 比例ピクセル) 主にフォントサイズを処理 in インチ mm ミリ pt 1/72インチ

AndroidのUI - AbsoluteLayout

activity_main.xml <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> </absolutelayout>

AndroidのUI - RelativeLayout

activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> </relativelayout>

AndroidのUI - GridLayout

activity_main.xml <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="4" android:rowCount="6" android:id="@+id/root" > </gridlayout>

AndroidのUI - FrameLayout2

MainActivity.java package com.example.liguofeng.framelayout;import android.os.Handler;import android.os.Message;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.widget.TextView;import java.util.Timer;…

AndroidのUI - FrameLayout

activity_main.xml <FrameLayout 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"> </framelayout>

AndroidのUI - TableLayout

tableLayout.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> </linearlayout>

AndroidのUI - LinearLayout

linearLayout.xml <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="right|center_vertical"> </linearlayout>

AndroidのUI - INDEX

レイアウトマネージャ Layout種類説明 LinearLayout ・ViewGroupを継承 ・縦OR横水平のレイアウト ・一列に収まらない場合、自動改行はしない。 ・android:orientation=<horizontal|vertical> 縦か横か ・android:gravity 配置位置top,bottom,left,rithgなどなど) TableLayout ・L</horizontal|vertical>…