# Divider

{% embed url="<https://developer.android.com/reference/com/google/android/material/divider/MaterialDivider>" %}
Fuente: developer.android
{% endembed %}

{% embed url="<https://m2.material.io/components/dividers>" %}
Fuente: material design
{% endembed %}

## DEFINICIÓN

Un `divider` es un `View` normal y corriente con unas características concretas que lo definen como `divider`.&#x20;

En la actualidad, se utilizan los `MaterialDividers` en vez de los `Dividers` normales pero en la Pallete Widgets el que aparece es el normal.

Existen dos tipos:

* **Divider Horizontal**
* **Divider Vertical**

## USO DESDE XML

{% code title="activity\_main.xml" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_margin="15dp">

        <View
            android:id="@+id/divider"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider" />
        <View
            android:id="@+id/divider2"
            android:layout_width="5dp"
            android:layout_height="260dp"
            android:background="?android:attr/listDivider" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="PRUEBA 1"/>
        <View
            android:id="@+id/divider3"
            android:layout_width="5dp"
            android:layout_height="260dp"
            android:background="?android:attr/listDivider" />
        <View
            android:id="@+id/divider4"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider" />
    </LinearLayout>
</ScrollView>
```

{% endcode %}

&#x20;                                         ![](/files/QIeEEB8NONpkuvKnfDFQ)

{% hint style="info" %}
Para saber más vea los enlaces de la parte superior de la página.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ricardev.gitbook.io/apuntes-android/escribiendo-tu-primera-app/paradigmas-de-diseno/views/pallete-widgets/divider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
