Obecná diskuze o vývojiAndroid studio Layout

Moderátoři: mArtinko5MB, mArtinko5MB

Odpovědět
LeoXXL
Nové Androidě
Příspěvky: 4
Registrován: ned 11. dub 2021 8:41:37

Android studio Layout

Příspěvek od LeoXXL »

Dobrý den.
Co dělam špatně?
Potřebují 2 tlačitka vedle sebe a 4 x těsně pod sebou.
https://pastebin.com/hZpbiGpF
Přílohy
111.png
111.png (8.76 KiB) Zobrazeno 2616 x
Uživatelský avatar
Crusty
Robot
Příspěvky: 938
Registrován: ned 19. črc 2009 17:30:40
Typ mobilu / ROM: Redmi Note 9 Pro
Bydliště: Praha
Kontaktovat uživatele:

Re: Android studio Layout

Příspěvek od Crusty »

u tech LinearLayout co jsou jako rady nastavit wrap_content pro height ... pokud maj byt ty rady hned pod sebou

Kód: Vybrat vše

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
 
    <!-- první řada -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">        
 
        <Button
            android:id="@+id/button1"
            android:text="Button 1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:layout_weight="1"
            android:gravity="center" />
 
        <Button
            android:id="@+id/button2"
            android:text="Button 2"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            />
    </LinearLayout>
    
    <!-- druha řada -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="top"
        android:orientation="horizontal">
        
        <Button
            android:id="@+id/button3"
            android:text="Button 3"
            android:layout_width="0dp"
	    android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
             />
 
        <Button
            android:id="@+id/button4"
            android:text="Button 4"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            />
    </LinearLayout>
 
</LinearLayout>
BigSandy
Stálý androiďák
Příspěvky: 145
Registrován: čtv 03. úno 2011 6:44:12

Re: Android studio Layout

Příspěvek od BigSandy »

Děkují mooooc. :palec:
Já už myslel, že na českých forech všichni programátoři, kteří chtěli pomoct začátečníkům, už vymřeli na covid.
Přece jeden přežil. :D
Děkují.
Uživatelský avatar
Crusty
Robot
Příspěvky: 938
Registrován: ned 19. črc 2009 17:30:40
Typ mobilu / ROM: Redmi Note 9 Pro
Bydliště: Praha
Kontaktovat uživatele:

Re: Android studio Layout

Příspěvek od Crusty »

jo, clovek si musi vytvaret konkurenci, aby sam mel duvod se stale posuvat :D
No ale spis vsichni hledaj hlavne v anglictine no ... coz je pochopitelne :)
Odpovědět

Zpět na „Obecná diskuze o vývoji“