0

開発中の Android アプリケーションに問題があります。

画面の上部に があり、残りのスペースを占めるマップがありますActivityEditText問題は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>

それでもテキストはレンダリングされません。

これが何が起こっているかの写真です:

非表示のテキストの一部がマークされた EditText

4

3 に答える 3

1

問題が見つかりました。Android の色は ARGB として整数で表されます。私は RGB のみを使用する HTML/CSS バックグラウンドから来ています。これにより、テキストカラーのアルファチャンネルを 0 に設定しました。これは完全に透明であることを意味します。私は本当に愚かです!助けてくれてありがとう。

于 2012-06-04T15:50:39.867 に答える
0

を使用してを下RelativeLayoutに配置してみMapViewますEditText

<?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" >

    <EditText
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:ems="10"
        android:inputType="text"
        android:text="@string/findingSatellites" />

    <com.google.android.maps.MapView
        android:id="@+id/bigMap"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="someapikey"
        android:layout_below="@id/status"
        android:clickable="true" >
    </com.google.android.maps.MapView>

</RelativeLayout>
于 2012-06-04T02:52:40.050 に答える
0

editText別のレイアウトに入れます。

于 2012-06-04T11:27:14.980 に答える