آموزش های این وب سایت به صورت رایگان در دسترس است. اطلاعات بیشتر
بروز خطا
   [message]
اشتراک در سوال
رای ها
[dataList]

مشکل در لایه بندی قالب XML (حل شد)

احمد اسدی  11 سال پیش  11 سال پیش
+1 0

سلام؛

به این کد یه نگاهی بندازید:

 <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ss"
    android:orientation="vertical">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1">

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:id="@+id/textView"
                    android:background="#ff48b7ff"
                    android:layout_weight="0.5"
                    android:layout_margin="2dp" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:id="@+id/textView3"
                    android:background="#ff48b7ff"
                    android:layout_weight="0.5"
                    android:layout_margin="2dp" />
            </LinearLayout>

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:text="WwWwW"
                    android:id="@+id/textView6"
                    android:background="#ff2c57ff" />
            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:layout_gravity="right">

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="130dp"
                android:id="@+id/textView2"
                android:background="#ffff4d9b"
                android:layout_weight="0.5"
                android:layout_margin="2dp" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:id="@+id/textView4"
                android:background="#ff85e2ff"
                android:layout_weight="0.5"
                android:layout_margin="2dp" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:id="@+id/textView7"
                android:background="#ff85e2ff"
                android:layout_weight="0.5"
                android:layout_margin="2dp" />

        </LinearLayout>

    </LinearLayout>

اون TextView ایی که مقدارش رو WwWw و در داخل LinearLayout قرار دادم چرا نمایش نمیده ؟ 

مٌردم از بس تست کردم :|

ضمنآ من با Android Studio کار میکنم.

0 0
ظاهرا که مشکلی نداره میخواین شما یک بار برنامرو ببندین بعد باز کنین.البته بعضی وقت ها بستن با خالی save کردن فرق داره.حالا یه امتحان کنین. (11 سال پیش)
0 0
چندین بار همینکارو رو انجام دادم، و حتی پروژه رو Clear کردم ولی همچنان مشکل پاربرجاست (11 سال پیش)
0 0
خب یک بار اون لایرو پاک کنین بعد بسازین. (11 سال پیش)
0 0
همین کارارو هم انجام دادم ولی نتیجه ای نگرفتم. شما همین کدها رو توی محیط Eclips کپی کردین مشکلی نداشت ؟ (11 سال پیش)
0 0
مشکلتونو فهمیدم.لینیر لیوتتون که text6 با مقداره WwWw توش هست میره زیر لینیر لیوت بالاییش.وگر نه وجود داره. (11 سال پیش)
0 0
خب چطور حل میشه ؟ متوجه نشدم (11 سال پیش)
0 0
چرا به جای dip نوشتید dp !! (11 سال پیش)
0 0
تفاوت آنچنانی ندارن جفتشم درسته. (11 سال پیش)
+1 0
Almassi جان، توی Android Stuido هر جفتش کار میکنه، یعنی من اگه فقط عدد خالی رو هم بزنم خودش خودکار dp رو میزنه. توی Eclips رو نمیدونم. (11 سال پیش)
 برای این سوال 1 پاسخ وجود دارد.
پاسخ به سوال 
ATRAS  11 سال پیش
+1 0

این کدو بزنین جای کد خودتون.

 <?xml version="1.0" encoding="utf-8"?>



<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ss"
android:orientation="vertical">


<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">


<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_weight="0.2" android:layout_height="fill_parent">

<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:background="#ff48b7ff"
android:layout_weight="0.5"
android:layout_margin="2dp" />

<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:id="@+id/textView3"
android:background="#ff48b7ff"
android:layout_weight="0.5"
android:layout_margin="2dp" />
</LinearLayout>


<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="WwWwW"
android:id="@+id/textView6"
android:background="#ff2c57ff" />
</LinearLayout>

</LinearLayout>

<LinearLayout
android:orientation="vertical"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_gravity="right">

<TextView
android:layout_width="fill_parent"
android:layout_height="130dp"
android:id="@+id/textView2"
android:background="#ffff4d9b"
android:layout_weight="0.5"
android:layout_margin="2dp" />

<TextView
android:layout_width="fill_parent"
android:layout_height="30dp"
android:id="@+id/textView4"
android:background="#ff85e2ff"
android:layout_weight="0.5"
android:layout_margin="2dp" />

<TextView
android:layout_width="fill_parent"
android:layout_height="30dp"
android:id="@+id/textView7"
android:background="#ff85e2ff"
android:layout_weight="0.5"
android:layout_margin="2dp" />

</LinearLayout>

</LinearLayout>
</LinearLayout>
0 0
ممنونم ATRAS جان؛ رفتم خونه چک میکنم. فقط میشه بگید دقیقآ مشکل از چی بود ؟ (11 سال پیش)
0 0
1-اینکه دو تا LinearLayout یادتون رفته بود ببندین. 2-تو حجم دهی و تنظیمات قرار گیری لایه هاتونو مشکل داشتین که با تنظیمات شما یکی از لایه ها نمایش پیدا میکرد ودیگری زیر لایه قرار میگرفت. (11 سال پیش)
0 0
ممنونم ATRAS جان؛ حق با شما بود و الان بدون مشکل کارم راه افتاد. تشکر :) (11 سال پیش)
0 0
خواهش میکنم.فقط بی زحمت یک کلمه حل شد به تیتر سوالتون اظافه کنید.تا دیگر دوستان اگر مشکلی داشتن استفاده کنن. (11 سال پیش)
0 0
اضافه شد. :) (11 سال پیش)

پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .