0
我跟着這個url link 我成功地做到了這一點,但文本框沒有響應觸摸。 我想寫在這個文本框中並獲取位置。我只需要知道如何讓文本框響應我的觸摸。 我該怎麼做?TextBox over MapFragment Clickable
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="fill_parent"
tools:context="">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="fill_parent"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ll"
android:orientation="horizontal"
android:layout_alignParentTop="true">
<TextView
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_margin="5dp"
android:background="@color/colorPrimary"
android:clickable="true"
/>
</LinearLayout>
要補充的onclicklistener的看法? – ingyesid
它不會只是沒有Java代碼響應? –
@ShubhamAgarwalBhewanewala textView沒有Java代碼沒有響應。我猜你需要在這裏使用EditText,這會給你選擇輸入一些值 – Arshad