「TextView設定」の編集履歴(バックアップ)一覧に戻る
TextView設定 - (2010/09/24 (金) 15:41:09) の編集履歴(バックアップ)
TextView各種設定に関して
方法 | 書式 | 説明 |
XML | android:width | 単位は以下の通り ・mm(ミリ) ・px(ピクセル) ・dp(density-independent pixels) ・sp(scaled pixels based on preferred font size) ・in(inches) 記述する場合は単位をつけて記述します。 (例)android:height="30px" |
Method | setWidth( int ) | メソッドで記述する場合は単位はピクセルのみの指定になります。 |
方法 | 書式 | 説明 |
XML | android:height | 単位は以下の通り ・mm(ミリ) ・px(ピクセル) ・dp(density-independent pixels) ・sp(scaled pixels based on preferred font size) ・in(inches) 記述する場合は単位をつけて記述します。 (例)android:height="30px" |
Method | setMaxHeight( int ) | メソッドで記述する場合は単位はピクセルのみの指定になります。 |
※幅と高さに関する注意点
ViewGroup.LayoutParamsのlayout_widthとlayout_heightを指定してサイズを指定している場合はFILL_PARENT指定が優先されるので気をつけること。
ViewGroup.LayoutParamsのlayout_widthとlayout_heightを指定してサイズを指定している場合はFILL_PARENT指定が優先されるので気をつけること。
[[リファレンス(XML)>http://developer.android.com/reference/android/widget/TextView.html#attr_android:textColor
]]
(Method)>http://developer.android.com/reference/android/widget/TextView.html#setWidth(int)]]
(ColorStateList)>http://developer.android.com/reference/android/content/res/ColorStateList.html]]
]]
(Method)>http://developer.android.com/reference/android/widget/TextView.html#setWidth(int)]]
(ColorStateList)>http://developer.android.com/reference/android/content/res/ColorStateList.html]]
方法 | 書式 | 説明 |
XML | android:textColor | |
Method | setTextColor( ColorStateList ) | メソッドで記述する場合は単位はピクセルのみの指定になります。 |