مشکل در لایه های android studio
با سلام خدمت دوستان
من تازه کار هستم و تازه شروع به یادگیری کردم ولی قبل از طرح سوال هرچقدر برای این مشکل سرچ کردم و خودم بالا و پایینش کردم به جایی نرسیدم.
من از Andorid Studio 1.5 که همین چند روز پیش آپدیت شد استفاده می کنم. راستش تمامی توصیه ها مبنی بر اینکه با همین اکلیپس کار کنم رو خوندم و اونم نصب کردم ولی خواستم با هر مشقتی هم که شده با استدیو شروع کنم که از الان بهش مسلط بشم.
و اما مشکل که مربوط به درس "حتی طراحی لایه های پیچیده" در قسمت اول آموزش ها می شود.
وقتی لایه درونی اول رو درست می کنم و 2 تا textview براش کپی می کنم و تنظیماتش رو می کنم متاسفانه روی همان خط اول نمایش داده می شود! و بعد از کلی کلنجار رفتن و تست کردن متوجه شدم وقتی قسمت اول کدهای آقای آقاجانی رو به جای کدهای اولیه جایگزین می کنم این مشکل حل می شود.
کدهای من:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.mehr.mytestp1.MainActivity"
tools:showIn="@layout/activity_main">
<TextView
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_margin="2dp"
android:background="#00f605"
android:id="@+id/textView2" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="48dp"
android:background="#00f605"
android:id="@+id/textView3"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_margin="2dp"
android:layout_weight=".5"
tools:ignore="ObsoleteLayoutParam" />
<TextView
android:layout_width="0dp"
android:layout_height="48dp"
android:background="#00f605"
android:id="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_margin="2dp"
android:layout_weight=".5"
tools:ignore="ObsoleteLayoutParam" />
</LinearLayout>
</RelativeLayout>
اما وقتی کد زیر را جایگزین ابتدای کد بالا می کنم مشکل حل می شود.
<TextView
android:layout_width="fill_parent"
android:layout_height="48dip"
android:background="#00ff00"
android:layout_margin="2dip"/>
با تمامی API ها هم تست کردم و هیچ اروری هم در Eventlog نشون نمی ده.
متشکرم
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .