2012-06-04 3 views
0

개발중인 Android 애플리케이션에 문제가 있습니다.MapActivity의 EditText에 표시되지 않는 텍스트

화면 상단에 EditTextActivity이 있고 나머지 공간을 차지하는지도가 있습니다. 문제는 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를 주석 처리하려고했지만 텍스트가 여전히 표시됩니다. 나는 EditTextTextView으로 바꾸려고 시도했지만 같은 결과가 나왔다. Activity에지도가있을 때 텍스트가 렌더링되지 않습니다.

업데이트 2 :
제안 사항에 따라 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> 

여전히 텍스트를 렌더링하지 않습니다.

The EditText with some of the invisible text marked

+0

너비가 wrap_content 인 것 같아. –

답변

1

문제점을 발견했습니다. 안드로이드의 색상은 ARGB의 정수로 표시되며, RGB 만 사용하는 HTML/CSS 배경을 사용하고 있습니다. 이로써 텍스트 색상의 알파 채널을 0으로 설정하여 완전히 투명하게 만들었습니다. 나는 정말로 어리 석다! 도와 줘서 고마워.

+0

그래서 정확히 무엇이 바뀌 었습니까? – Umopepisdn

0

나는 MapView 다른 레이아웃에 editText을 넣어 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> 
+0

정확하게 똑같은 결과가 나옵니다. 지도는 EditText 아래에 표시되지만 EditText 내의 텍스트는 렌더링되지 않습니다. – JPuge

0

아래 위치로 RelativeLayout를 사용하려고 할 것 : 여기

은 무슨 일이 일어나고 있는지의 사진입니다.

+0

나는 EditText와 MapView를 둘 다 분리 된 LinearLayout에 놓으려고했는데, RelativeLayout 내부는 ant sugested입니다. 이것은 나에게 같은 결과를 준다. EditText를 별도의 LinearLayout에 넣으려고했는데 어느 것도 작동하지 않았습니다. – JPuge

+0

상대 레이아웃으로 시도하십시오. 나는 이미 내 프로젝트에서 이것을 수행한다. –

+0

나는 그것을 시도했지만 여전히 효과가 없다. 위 코드는 위에 게시되었습니다 ... – JPuge

관련 문제