p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Android 2 Application Development (http://p2p.wrox.com/forumdisplay.php?f=547)
-   -   Chapter 4 : Todo List Item, can't see text (http://p2p.wrox.com/showthread.php?t=79948)

IAmCorbin June 29th, 2010 03:45 AM

Chapter 4 : Todo List Item, can't see text
 
I have followed the book as far as I can tell and have gone back and rechecked things (I'm up to page 96).

The application works in that I can type in a list item and add it to the list. A new list item appears each time I add one, but I can't see the text for any of them. I thought it was a typo for the text color, but I have even copied the text color line from todolist_item.xml:

Code:

android:textColor="@color/notepad_text"
Into main.xml to change the edit text color:
Code:

<EditText
          android:id="@+id/myEditText"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textColor="@color/notepad_text"
          android:text="New To Do Item"
        />

This text properly changes color for the edit box, but I can't get anything to appear in the list. The paper color and margin lines are drawing fine just can't see any text.

IAmCorbin June 29th, 2010 02:56 PM

downloaded the book code and found my problem.

Code:

this.margin = myResources.getColor(R.color.notepad_margin);
should be:
Code:

this.margin = myResources.getDimension(R.dimen.notepad_margin);
oops.


All times are GMT -4. The time now is 11:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.