Issue
I have a problem with an android application I am developing.
I have an Activity with an EditText at the top of the screen, and a map taking over the rest of the space. The problem is that the EditText don't show any of the text I put in it. You can focus the EditText and type more text or even select the text that the app put in the EditText and copy it. When you paste it in another application, you can see that it is the text that suppose to be in the EditText. So I know that the text is there, but I really don't understand why the text isn't shown.
I have tried changing the background color of the EditText (which worked, but text still is invisible) and changing the text color (which changed nothing). Here is my XML file:
<?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>
The map is shown correctly. Can you help me?
UPDATE:
I have tried to comment out the map from the XML file (and code) and now the text inside the EditText is rendered. I also tried to comment out my MapOverlay, but the text is still now shown. I tried replacing the EditText with a TextView with the same result. How come no text is rendered when there is a map in the Activity?
UPDATE2:
I have modified my xml according to your suggestions. This is what I have now:
<?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>
It still doesn't render any text.
Here is a picture of what is happening:

Solution
I have found the problem. Colors on android is represented by integers as ARGB, and I'm comming from a HTML/CSS background which only uses RGB. This made me set the alphachannel for the textcolor to 0, meaning fully transparent. I am really stupid! Thanks for your help guys.
Answered By - JPuge
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.