戻る?


レイアウト

ViewとViewGrpup

  ・Viewの集まりをViewGroupという
  ・ViewGroupは複数のViewを含む
  ・ViewGroupの中にViewGroupを含むこともできる

単位

  利用可能な単位
  px (ピクセル)
  dp (密度非依存ピクセル)
  sp (倍率非依存ピクセル)
  in (インチ)
  mm (ミリメータ)

レイアウトの種類

Ansolute layout

  工事中

Relative layout

Linear layout

  縦に並べたり
  横に並べたり

Table layout

  表形式に並べるレイアウト

  tablelayout2.pngtablelayout.png
     Outline              画面

 次世代創造機構

 ボタンのレイアウト
 http://www.javadrive.jp/android/xml_layout/index7.html

 画面の作り方
 http://www.techfirm.co.jp/lab/android/view.html

 Android Developer
 http://www.techdoctranslator.com/android/guide/ui/declaring-layout  

Viewのプロパティ

 参考 - Android Wiki

 ・nextFoxusDown - フォーカスが下方向に遷移した時の遷移先Viewを定義
 ・padding - 上下左右のパディングを設定
 ・scrollbarAlwaysDrawVerticalTrack - スクロールバーを表示するかどうか

ViewGroupのプロパティ

 参考 - Android Wiki

absolute layout

絶対座標の指定

  layout_x 
  layout_y 

部品の幅・高さ指定

  layout_width
  layout_height
  fill_parentは最大サイズ。wrap_contentは最小サイズ

  

Relative レイアウト



縦向きレイアウトと横向きレイアウト

 横向き画面には、"Layout-land"用フォルダを用意する。

layout-land.jpg



戻る?


Front page   New List of pages Search Recent changes   Help   RSS of recent changes