PDA

View Full Version : مشکل قرار دادن دو آیتم بروی هم در Reliteve Layout



imanx7
دوشنبه 28 دی 1394, 13:12 عصر
سلام
من دو آیتم textView و Button دارم که قرار textView رو بندازم رو Button درصورتی که این کار انجام میشه اما textView میره زیر Button
چی کار کنم تکستم بیاد بالای باتن؟


<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">


<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="آپدیت"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/color_primary"
android:layout_centerInParent="true" />

<Button
android:id="@+id/btnUpdate"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_dialog" />
</RelativeLayout>

msroid
دوشنبه 28 دی 1394, 19:10 عصر
سلام

توی فایل xml برعکس باید عمل کنی یعنی اونی که میخوای زیر قرار بگیره رو باید بالاتر قرار بدی. پس اول button رو قرار بده بعد textview.