Notes de développement Android 1.0 LinearLayout linéaire mise en page

android: id identité

android: id = "@ + id / nom" pour créer un identifiant

Applications: largeur layout_width

Largeur layout_width = « wrap_content » contenu adaptatif: androïde

Applications: layout_width = parent « de match_parent » correspondant à la largeur de l'espace

android: hauteur layout_height

android: layout_height = utilisation dp "520dp" unités

Android: Marge Marge

Applications: rembourrage rembourrage intérieur

    android: paddingLeft = dans les "20dp" marge de gauche

    android: marges droite dans paddingRight

    Applications: rembourrage sur paddingTop

    Applications: rembourrage à l'intérieur de la prochaine paddingBottom

android: fond d'arrière-plan

android: background = "# 000000" fond noir

Applications: direction d'orientation

Applications: orientation = « verticale » la direction perpendiculaire à

Applications: orientation = sens horizontal "horizontal"


<? xml version = "1.0" encoding = "utf-8" >?
 < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
 xmlns: app = « http://schemas.android .com / apk / res-auto "
 xmlns: outils = "http://schemas.android.com/tools"
 android : layout_width = "match_parent"
 android : layout_height = "match_parent"
 outils : contexte = " com.example.administrator .myapplication.MainActivity »
 android : background = "# 00ff55"
                            "vertical" >

    < LinearLayout
 android : id = "@ + id / L1"
 android : layout_width = "200dp"
 android : layout_height = "300dp"
 android : background = "# 000000"
 android : orientation = "vertical"
 android : layout_margin = "30dp"
 androïde : padding = "20dp"
 >
        < LinearLayout
 androïde : id = "@ + id / L2"
 applications : fond = "#ffffff"
 androïde :orientation = "vertical"
 androïde : layout_width =                                                                            
                                    "match_parent"
 android : layout_height = "match_parent" >
        </ LinearLayout >
    </ LinearLayout >
    < LinearLayout
 android : id = "@ + id / L3"
 android : layout_width = "match_parent"
 android : layout_height = "match_parent"
 android : layout_margin = "20dp"
 android : background = "# FF0000"
 android : orientation = "vertical"
 >
    </ LinearLayout >
</ LinearLayout >            

                                                        



 
 
效果图


发布了16 篇原创文章 · 获赞 3 · 访问量 4536

Je suppose que tu aimes

Origine blog.csdn.net/qq_29697901/article/details/79488125
conseillé
Classement