我不知道它有什么問題,但它只是讓我的應用程式崩潰,如果你需要,我稍后會發布我的 java 代碼,因為堆疊現在不允許我這樣做。當我評論 EditTexts 時它作業正常但不是按需要所以我相信有些事情是錯了
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
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">
<EditText
android:id="@ id/A"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<EditText
android:id="@ id/B"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<EditText
android:id="@ id/C"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@ id/calculate"
android:text="calculate"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@ id/output"
/>
</androidx.core.widget.NestedScrollView>
uj5u.com熱心網友回復:
( Nested)ScrollView只能有一個直系子女。基本上,ScrollView負責滾動,但只需要一個元素即可滾動。
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
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">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<EditText
android:id="@ id/A"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<EditText
android:id="@ id/B"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<EditText
android:id="@ id/C"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@ id/calculate"
android:text="calculate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@ id/output" />
</LinearLayout >
</androidx.core.widget.NestedScrollView>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/527061.html
標籤:爪哇安卓xml
上一篇:Google地圖示記未在google_maps_flutter中更新
下一篇:流不回傳任何值
