דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תכנות
  3. vertical ב-activity_main.xml לא עובד כמצופה

vertical ב-activity_main.xml לא עובד כמצופה

מתוזמן נעוץ נעול הועבר תכנות
3 פוסטים 2 כותבים 184 צפיות
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • yyyY מנותק
    yyyY מנותק
    yyy
    כתב ב נערך לאחרונה על ידי
    #1

    צהרים טובים!
    שאלה של מתחיל בפיתוח לאנדרואיד:
    אני מנסה למקם LinearLayout בעל orientation של vertical, כאשר בתוכו יש כמה LinearLayout כאשר הם בעלי orientation של horizontal, בכדי להגיע לתצוגה טבלאית.
    בפועל באפליקציה מוצג לי רק ה-LinearLayout העליון
    מדוע זה קורה?
    תודה רבה - מצו"ב קוד לדוגמא

    <?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:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:orientation="vertical"><--------------------------
    
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".MainActivity"
            android:orientation="horizontal"><--------------------------
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
    
        </LinearLayout>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".MainActivity"
            android:orientation="horizontal"><--------------------------
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
    
        </LinearLayout>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".MainActivity"
            android:orientation="horizontal"><--------------------------
    
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!" />
    
        </LinearLayout>
    
    
    </LinearLayout>
    
    OdedDvirO תגובה 1 תגובה אחרונה
    0
    • OdedDvirO מנותק
      OdedDvirO מנותק
      OdedDvir
      השיב לyyy ב נערך לאחרונה על ידי OdedDvir
      #2

      @yyy סתם שאלת תם 🤔 : (בתור מי שעדיין לא התחיל בכלל בפיתוח לאנדרואיד...)
      למה שלא תשתמש ב TableLayout שמיועד לטבלאות? יש כאן דוגמא

      yyyY תגובה 1 תגובה אחרונה
      0
      • yyyY מנותק
        yyyY מנותק
        yyy
        השיב לOdedDvir ב נערך לאחרונה על ידי
        #3

        @odeddvir כי לא לכל דבר מתאימה טבלה.
        בכ"א הפתרון הוא לשנות את

        android:layout_height="match_parent"
        

        ל-

        android:layout_height="wrap_content"
        
        תגובה 1 תגובה אחרונה
        1
        • dovidD dovid העביר נושא זה מ-תכנות ב-

        בא תתחבר לדף היומי!
        • התחברות

        • אין לך חשבון עדיין? הרשמה

        • התחברו או הירשמו כדי לחפש.
        • פוסט ראשון
          פוסט אחרון
        0
        • דף הבית
        • קטגוריות
        • פוסטים אחרונים
        • משתמשים
        • חיפוש
        • חוקי הפורום