SlideShare a Scribd company logo
1 of 4
Practica 2: ”ScrollView en Android”
Aplicación:La pantallase encuentradivididaendospartesiguales,estaspartestienenun
ScrollViewcadauna,perocon diferentesorientaciones,ycadaScrollView tienevariosbotones.
Código:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.lap_c_pc38.myapplication2.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/button74"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button81"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button80"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button79"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button78"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button77"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button76"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button75"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button72"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</ScrollView>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/button109"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button122"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button121"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button120"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button119"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button118"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button117"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button110"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button111"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="@+id/button112"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
Captura:
Conclusión:En estaactividadaprendíque se puedencombinardiferentesobjetosparaorganizary
hacer diferentescosasque soloarrastrandocosasno se puedenhacer.

More Related Content

What's hot

Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)Melina Krisnawati
 
Quick tips for android
Quick tips for androidQuick tips for android
Quick tips for androidDaniel Baccin
 
Actividad 01
Actividad 01Actividad 01
Actividad 01Jose AC
 
Aula 10 04 (Gerenciadores de layouts)
Aula 10 04 (Gerenciadores de layouts)Aula 10 04 (Gerenciadores de layouts)
Aula 10 04 (Gerenciadores de layouts)Ricardo Longa
 
La vista video view
La vista video viewLa vista video view
La vista video viewYanori Perez
 
Penambahan menu atau tampilan
Penambahan menu atau tampilanPenambahan menu atau tampilan
Penambahan menu atau tampilaniswan_di
 
Actividad 03
Actividad 03Actividad 03
Actividad 03Jose AC
 
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...Javascript & Angular .js for the enterprise, lessons learned, typescript scal...
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...David Amend
 
Les Fondamentaux D'Angular JS | Hmidi Hamdi
Les Fondamentaux D'Angular JS | Hmidi HamdiLes Fondamentaux D'Angular JS | Hmidi Hamdi
Les Fondamentaux D'Angular JS | Hmidi HamdiHamdi Hmidi
 

What's hot (19)

Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
 
Fragmentwithouttag
FragmentwithouttagFragmentwithouttag
Fragmentwithouttag
 
Practica 4
Practica 4Practica 4
Practica 4
 
Practica 5
Practica 5Practica 5
Practica 5
 
Quick tips for android
Quick tips for androidQuick tips for android
Quick tips for android
 
Actividad 01
Actividad 01Actividad 01
Actividad 01
 
Actividad 01
Actividad 01Actividad 01
Actividad 01
 
Aula 10 04 (Gerenciadores de layouts)
Aula 10 04 (Gerenciadores de layouts)Aula 10 04 (Gerenciadores de layouts)
Aula 10 04 (Gerenciadores de layouts)
 
Codificacion1
Codificacion1Codificacion1
Codificacion1
 
La vista video view
La vista video viewLa vista video view
La vista video view
 
La vista video view
La vista video viewLa vista video view
La vista video view
 
Penambahan menu atau tampilan
Penambahan menu atau tampilanPenambahan menu atau tampilan
Penambahan menu atau tampilan
 
Actividad 03
Actividad 03Actividad 03
Actividad 03
 
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...Javascript & Angular .js for the enterprise, lessons learned, typescript scal...
Javascript & Angular .js for the enterprise, lessons learned, typescript scal...
 
Practica 3
Practica 3Practica 3
Practica 3
 
Programa6
Programa6Programa6
Programa6
 
Les Fondamentaux D'Angular JS | Hmidi Hamdi
Les Fondamentaux D'Angular JS | Hmidi HamdiLes Fondamentaux D'Angular JS | Hmidi Hamdi
Les Fondamentaux D'Angular JS | Hmidi Hamdi
 
Portafolio 2do parcial
Portafolio 2do parcialPortafolio 2do parcial
Portafolio 2do parcial
 
Pemrograman mobile b tugas 1_1404505042
Pemrograman mobile b tugas 1_1404505042Pemrograman mobile b tugas 1_1404505042
Pemrograman mobile b tugas 1_1404505042
 

More from Erick Ramirez (20)

Ansdroid Studio
Ansdroid StudioAnsdroid Studio
Ansdroid Studio
 
Lenguajes
LenguajesLenguajes
Lenguajes
 
Plataformas
PlataformasPlataformas
Plataformas
 
Diagnostico
DiagnosticoDiagnostico
Diagnostico
 
Reto laberinto
Reto laberintoReto laberinto
Reto laberinto
 
Proyecto integrador
Proyecto integradorProyecto integrador
Proyecto integrador
 
Programa arreglos 2
Programa arreglos 2Programa arreglos 2
Programa arreglos 2
 
Programa arreglos 1
Programa arreglos 1Programa arreglos 1
Programa arreglos 1
 
Programa 20
Programa 20Programa 20
Programa 20
 
Programa 19
Programa 19Programa 19
Programa 19
 
Programa 18
Programa 18Programa 18
Programa 18
 
Programa 17
Programa 17Programa 17
Programa 17
 
Programa 16
Programa 16Programa 16
Programa 16
 
Programa 13
Programa 13Programa 13
Programa 13
 
Programa 12
Programa 12Programa 12
Programa 12
 
Programa 11
Programa 11Programa 11
Programa 11
 
Programa 10
Programa 10Programa 10
Programa 10
 
Programa 9
Programa 9Programa 9
Programa 9
 
Programa 8
Programa 8Programa 8
Programa 8
 
Programa 7
Programa 7Programa 7
Programa 7
 

Practica 2

  • 1. Practica 2: ”ScrollView en Android” Aplicación:La pantallase encuentradivididaendospartesiguales,estaspartestienenun ScrollViewcadauna,perocon diferentesorientaciones,ycadaScrollView tienevariosbotones. Código: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.lap_c_pc38.myapplication2.MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/button74" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button81" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button80" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button79" android:layout_width="match_parent"
  • 2. android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button78" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button77" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button76" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button75" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button72" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout> </ScrollView> <HorizontalScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal"> <Button android:id="@+id/button109" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button122" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"
  • 3. android:text="Button" /> <Button android:id="@+id/button121" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button120" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button119" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button118" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button117" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button110" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button111" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button112" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" />
  • 4. </LinearLayout> </HorizontalScrollView> </LinearLayout> </android.support.constraint.ConstraintLayout> Captura: Conclusión:En estaactividadaprendíque se puedencombinardiferentesobjetosparaorganizary hacer diferentescosasque soloarrastrandocosasno se puedenhacer.