我的 findViewById 不作業。它沒有鏈接...
////我的fragment.contacts.xml
*<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
tools:context=".MainActivity">
<EditText
android:id="@ id/txtShowOnMap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:contentDescription="@string/locationonmap"
android:importantForAutofill="no"
android:inputType="text"
android:labelFor="@id/btnShowOnMap"
android:minHeight="48dp"
android:text="@string/store_location" />
<Button
android:id="@ id/btnShowOnMap"
android:layout_width="395dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="@string/map" />
</LinearLayout>*
////fragmentcontacts.xml 結束
我的聯系人片段.kt

uj5u.com熱心網友回復:
請將其設為view.findViewById 對于片段,您需要添加 rootview。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/476223.html
上一篇:Firebase和ReactAuth如何更新用戶資訊
下一篇:回收站視圖未顯示在片段內
