LunarLander

Put your problem here if it does not fit any of the other categories.

LunarLander

Postby borut123 » Thu Mar 20, 2008 12:46 pm

Hi

http://code.google.com/android/samples/ ... index.html

I'm trying to change this code not to use the xml file for generating TextView and View.
With other words, I want to create views in the code.

This should be quite easy to do. But unfortunately I'm lost somewhere between Layouts and
how to put TextView on a screen.

Could somebody please help me or at least point me to the page where such kind of things are explained.


BR
Borut


xml file:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<com.google.android.lunarlander.LunarView
android:id="@+id/lunar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/earthrise" />

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/text"
android:text="@string/lunar_layout_text_text"
android:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="false"
android:textAlign="center"
android:textColor="#88ffffff"
android:textSize="24sp"/>
</RelativeLayout>

</FrameLayout>
borut123
Freshman
Freshman
 
Posts: 2
Joined: Tue Mar 11, 2008 11:01 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests