APUNTES ANDROID
  • Introducción
  • Apuntes Linux
  • Apuntes Red Team
  • Apuntes Blue Team
  • Apuntes Python
  • Ricardev github
  • Escribiendo tu primera App
    • Instalar Android Studio
    • Proyecto
    • Ejecutar una App
    • Anatomía del Proyecto
      • Gradle scripts
      • AndroidManifest.xml
      • Java
      • Res
    • Componentes de una App
      • Activities
      • Fragments
      • Views y ViewGroups
      • Services
      • Broadcast Receivers
      • Intents
      • Content Provider
      • Widgets
    • Paradigmas de diseño
      • Views
        • Pallete Texts
          • TextView
          • EditText
          • AutoCompleteTextView
        • Pallete Buttons
          • Button
          • ImageButton
          • Chip y ChipGroup
          • RadioButton y RadioGroup
          • CheckBox
          • ToggleButton
          • Switch
          • FloatingActionButton
        • Pallete Widgets
          • ImageView
          • ShapeableImageView
          • WebView
          • VideoView
          • CalendarView
          • ProgressBar
          • SeekBar
          • RatingBar
          • SearchView
          • Divider
        • Custom Views
        • View Binding
      • Jetpack Compose
    • Layouts
      • FrameLayout
      • Linear Layout
      • Relative Layout
      • Constraint Layout
      • Table Layout
      • Grid Layout
    • Containers
      • Spinner
      • RecyclerView
      • CardView
      • ScrollView y HorizontalScrollView
      • ViewPager2
      • AppBarLayout y BottomAppBar
      • NavigationView y BottomNavigationView
      • Toolbar y MaterialToolbar
      • TabLayout y TabItem
      • ViewStub
      • etiquetas <include> y <merge>
Powered by GitBook
On this page
  • DEFINICIÓN
  • USO DESDE XML
  1. Escribiendo tu primera App
  2. Paradigmas de diseño
  3. Views
  4. Pallete Widgets

Divider

Explicación del concepto de Divider.

PreviousSearchViewNextCustom Views

Last updated 2 years ago

DEFINICIÓN

Un divider es un View normal y corriente con unas características concretas que lo definen como divider.

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

activity_main.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>

Para saber más vea los enlaces de la parte superior de la página.

Material DesignMaterial Design
Fuente: material design
Logo
MaterialDivider  |  Android DevelopersAndroid Developers
Fuente: developer.android
Logo