Skip to content

Instantly share code, notes, and snippets.

Created May 19, 2015 21:51
Show Gist options
  • Select an option

  • Save anonymous/cd7fda2fa5c4062acb92 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/cd7fda2fa5c4062acb92 to your computer and use it in GitHub Desktop.
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:text="Guest List"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Kunal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
@Dushyant-cmd
Copy link

ViewGroup(LinearLayout) orientation is vertical means all child views inside of LinearLayout view group position in vertical on screen of android device.
android:layout_width="wrap_content": It set the width of view group to content inside of it simply wrap all smaller views inside of it
android;layout_height="wrap_content": It set the height of view group to content height inside of LinearLayout contains

@Gisela0904
Copy link

La orientación que se eligio es lineal, vertical
El recuadro que esta detras del texto se acomoda a su largo y ancho
Las vistas de texto son hermanos

@AsmaShakeel-thecoder
Copy link

parent view is linear and it has 2 child views. Opening and closing of parent view and child view is same i.e. through angle braces and forth slash.

@paulorabelo
Copy link

The parent group (LinearLayout) has three configurations: orientation is vertical and width and height layouts that are both wrap content. Both of TextViews have width and height layouts set to wrap content and a text config thats contains the text thats appears on the screen.

@TIGRAN-rosian
Copy link

  1. Linear layout is a viewGroup. its orientation is in vertical fashion.
  2. one of the child group is a textGroup.
    3)Other child group is also a textgroup.

@abellop
Copy link

abellop commented Aug 21, 2022

  • existen un ViewGroups padre con 2 vistas (TextView )
  • se determina la posición ( android:orientation="vertical")
  • al ancho y alto de la vista padre esta determinada en ("wrap_content") para que le contenido se ajutes.

@tarunaksha
Copy link

  1. I prefer Relative layout over LinearLayout after using

@SandeepLakka
Copy link

  • Parent view orientation is set as vertical to allow for vertical stacking
  • Each text views are placed according to the order they are given in the parent layout
  • Parent view is LinearLayout

@meedaf12
Copy link

meedaf12 commented Nov 7, 2022

1- ViewGroupe is LinearLayout
2- orientation vertical
3- two child

@lalaodder
Copy link

  1. ViewGroup it's a element "LinearLayout".
  2. The sentence indicates that the orientation of the childs contained within the ViewGroup, wil be aligned vertically.
  3. The 2 childs elements are "TextView".

@wingmike
Copy link

wingmike commented Aug 4, 2024

1,there is no forward slash at the top lineaylayout 2,new atribiut android:orientation="vertical" 3,the linearlayout at the bottom starts with </

@eskadimasmelaku
Copy link

This XML code defines a vertical LinearLayout containing two TextView elements, one displaying "Guest List" and the other displaying "Kunal". Each element's width and height are set to wrap their respective content.

@zsegla
Copy link

zsegla commented Sep 2, 2024

  1. Linear Layout is Vertical
  2. Their are two TextViews
  3. Linear Layout is group view

@Gebrushet
Copy link

  1. Text Views are not centered,
  2. View Group not identified due to no background color,
  3. No spacing between Text views.

@tsediatgstu
Copy link

,there is no forward slash at the top lineaylayout

@Ashra0915
Copy link

The code starts with opening tag
the code includes new attribute called : android:orientation
The code has two TextViews as siblings
the code ends with closing tag

@Asli5455
Copy link

View GROUP is linear layout
Vertical Orientation
Two Text view

@Berhanus
Copy link

The parent[LinearLayout] has two TextView as the children and oriented vertical

@AdamBeyu
Copy link

parent view on the LinearLayout has two TextView and Children and Oriented Vertical

@FilimonAlem
Copy link

  1. There is new linear layout keyword.
  2. There is new android orientation attribute.
  3. There are two text views inside the linear layout.

@megersayedin
Copy link

  1. There is new linear layout keyword.
  2. There is new android orientation attribute.
  3. There are two text views inside the linear layout.

@megersayedin
Copy link

<script src="https://gist.github.com/anonymous/cd7fda2fa5c4062acb92.js"></script>

@Amanuel3003
Copy link

One parent view: LinearLayout
Two children views: TextView
Linear layout orientation: vertical Height and width: wrap content

@DrMisDan
Copy link

DrMisDan commented Jul 24, 2025

Separate opening and closing tag used
Parent view is in Linear layout and Vertical orientation
Within it are 2 child TextViews
Width and Height of both parent and child views is set to automatically resize by the special code wrap_content

@lidros-ai
Copy link

linearLayout is a parent view
TextView is a child

@DestaGurmessa
Copy link

  1. one parent view group
  2. two child view

@talaqsrawy-hash
Copy link

View group is a LinearLayout : parent
LinearLayout have orientation : vertical
LinearLayout have heigth and width : wrap_content

@defrank138-code
Copy link

ViewGroup it's a element "LinearLayout".
The sentence indicates that the orientation of the childs contained within the ViewGroup, wil be aligned vertically.
The 2 childs elements are "TextView".

@lemiakinew
Copy link

What the difference between linearLayout and textView

@foziayube0-cyber
Copy link

TextView

· What it is: A widget for displaying text.
· Purpose: Shows text on the screen (like labels, messages, titles).
· Analogy: A single picture frame that holds a photo (text).
· Example usage:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!" />

LinearLayout

· What it is: A layout container for organizing other views.
· Purpose: Arranges child views in a single row (horizontal) or column (vertical).
· Analogy: A shelf that holds multiple picture frames (TextViews, Buttons, etc.) in a line.
· Example usage:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    
    <TextView android:text="First Item"/>
    <TextView android:text="Second Item"/>
    <Button android:text="Click Me"/>
    
</LinearLayout>

Key Differences

Aspect TextView LinearLayout
Type View (widget) ViewGroup (container)
Purpose Display text Arrange other views
Children Cannot have child views Can contain multiple child views
Common Use Labels, messages, titles Organizing UI elements linearly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment