背景色などを変える |
自前のレアウトの例です。 文字、背景色をカスタマイズしています。 まずlayoutフォルダーにlv.xmlを設置します。 lv.xmlの内容です。 <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#004400" android:paddingStart="20dp" android:paddingEnd="10dp" android:textSize="24sp" android:textColor="#aaaadd" > </TextView> MainActivity.javaは超簡単表示と比べると、 int id = R.layout.lv; が違うだけです。 このように自前のレアウトを作成できます。 |