Рамка, margin

Интерфейс, диалоги, темы, стили, меню
Ответить
Lemme
Сообщения: 16
Зарегистрирован: 29 янв 2015, 23:38

Рамка, margin

Сообщение Lemme » 08 фев 2015, 12:22

Всем привет, есть такой Layout, он является элементом для ListView.

1) Как можно сделать между списками отступ (как в css margin), пробовал android:layout_marginBottom="10dp" у первого LinearLayout, ничего не получилось.

2) Таким образом добавляю рамку вокруг элемента android:background="@drawable/post_items_border"

Код: Выделить всё

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
    <stroke android:width="1dip" android:color="#000000"/>
</shape>
но ее перекрывает фон вложенного LinearLayout (белый фон). Как это исправить?

Код: Выделить всё

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/post_items_border">

    <com.android.volley.toolbox.NetworkImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/thumbnail"/>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:background="#ffffff>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="Large Text"
            android:id="@+id/title" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="Medium Text"
            android:id="@+id/date" />
    </LinearLayout>

</LinearLayout>

ANdriy123456
Сообщения: 138
Зарегистрирован: 27 июн 2014, 01:41

Re: Рамка, margin

Сообщение ANdriy123456 » 09 фев 2015, 03:25

<ListView
...........
android:divider="#00000000"
android:dividerHeight="10dp">
</ListView>

Ответить