開発中の Android アプリケーションに問題があります。
画面の上部に があり、残りのスペースを占めるマップがありますActivity
。EditText
問題はEditText
、入力したテキストが表示されないことです。にフォーカスしてEditText
さらにテキストを入力したり、アプリが挿入したテキストを選択してEditText
コピーしたりすることもできます。別のアプリケーションに貼り付けると、EditText
. テキストがそこにあることは知っていますが、テキストが表示されない理由が本当にわかりません。
の背景色を変更しようとしましたがEditText
(うまくいきましたが、テキストはまだ見えません)、テキストの色を変更しました (何も変わりませんでした)。ここに私のXMLファイルがあります:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical" >
<EditText
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/findingSatellites"
android:inputType="text"
android:ems="10" />
<com.google.android.maps.MapView
android:id="@+id/bigMap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="someapikey"
android:clickable="true" >
</com.google.android.maps.MapView>
</LinearLayout>
地図は正しく表示されます。手伝って頂けますか?
更新:
XML ファイル (およびコード) からマップをコメントアウトしようとしましたが、現在は内部のテキストEditText
がレンダリングされています。MapOverlay もコメントアウトしようとしましたが、テキストはまだ表示されています。EditText
をaに置き換えてみましたTextView
が、同じ結果になりました。にマップがあるのにテキストがレンダリングされないのはActivity
なぜですか?
UPDATE2:
あなたの提案に従って xml を変更しました。これは私が今持っているものです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true" >
<RelativeLayout
android:id="@+id/statusLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<EditText
android:id="@+id/status"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:text="@string/findingSatellites" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mapLayout"
android:layout_below="@id/statusLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" >
<com.google.android.maps.MapView
android:id="@+id/bigMap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0ZGxti1I-qNSsMmsOCqnbPsnNG7Sl4U2aHvDc-Q"
android:clickable="true" />
</RelativeLayout>
</RelativeLayout>
それでもテキストはレンダリングされません。
これが何が起こっているかの写真です: