![](/img/trans.png)
[英]Why is it showing stackoverflowerror when i am trying to create an object in it's own class?
[英]I am trying to place a button at the bottom of LinearLayout. But it's not showing
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Quantity" />
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="0"
android:textColor="@color/black"
android:textSize="16sp" />
<Button
android:id="@+id/button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Order" />
</LinearLayout>
我是 Android 的新手。 我正在 Udacity 學習 Android。 但是課程已經很老了,以至於發生了一些錯誤。 我無法處理錯誤。
將quantity_text_view
的 layout_height 從match_parent
更改為wrap_content
:
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/black"
android:textSize="16sp" />
或者,TextView 應該占據第一個 TextView 之后的高度的 rest。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.