LoginSignup
1
0

More than 3 years have passed since last update.

tools 属性を使ってプレビュー表示

Posted at

レイアウトプレビューで
<ListView tools:listitem="@layout/list_custom_item"
のようにListViewにカスタムレイアウトを指定することで
プレビュー画面でリストアイテムを表示させることができる。

tools 属性を使うと、プレビュー画面がもっと便利になる。
https://developer.android.com/studio/write/tool-attributes.html

activity_list.xml
<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">

    <ListView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:listitem="@layout/list_custom_item"/>

</LinearLayout>

いじょ。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0