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

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

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

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

מתוזמן נעוץ נעול הועבר תכנות
3 פוסטים 2 כותבים 259 צפיות 2 עוקבים
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
תגובה
  • תגובה כנושא
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • 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
    • yyyY yyy

      צהרים טובים!
      שאלה של מתחיל בפיתוח לאנדרואיד:
      אני מנסה למקם 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
      OdedDvirO
      OdedDvir
      כתב ב נערך לאחרונה על ידי OdedDvir
      #2

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

      yyyY תגובה 1 תגובה אחרונה
      0
      • OdedDvirO OdedDvir

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

        yyyY
        yyyY
        yyy
        כתב ב נערך לאחרונה על ידי
        #3

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

        android:layout_height="match_parent"
        

        ל-

        android:layout_height="wrap_content"
        
        תגובה 1 תגובה אחרונה
        1

        שלום! נראה שהשיחה הזו מעניינת אותך, אבל עדיין אין לך חשבון.

        נמאס לכם לגלול בין אותם הפוסטים בכל ביקור? כשנרשמים לחשבון, תמיד תחזרו בדיוק למקום שבו הייתם קודם, ותוכלו לבחור לקבל התראות על תגובות חדשות (בין אם במייל, ובין אם בהתראת פוש). תוכלו גם לשמור סימניות ולפרגן ב-upvote לפוסטים כדי להביע הערכה לחברי קהילה אחרים.

        בעזרת התרומה שלך, הפוסט הזה יכול להיות אפילו טוב יותר 💗

        הרשמה התחברות
        תגובה
        • תגובה כנושא
        התחברו כדי לפרסם תגובה
        • מהישן לחדש
        • מהחדש לישן
        • הכי הרבה הצבעות


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

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

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