TableLayout layout params

by kingkung » Wed, 07 May 2008 17:51:42 GMT


Sponsored Links
 I understand the inherited structure of the LayoutParams (parent--
what I do:

XML:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/view_contact"
        xmlns:android=" http://schemas.android.com/apk/res/android" ;
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
</TableLayout>

JAVA:

        private void populateData(AndroidContact ac)
        {
                TableLayout tl = (TableLayout)findViewById(R.id.view_contact);

                TableRow tr = null;
                TextView tv=null;
                if (ac.name!=null)
                {
                        (tr = new 
TableRow(this)).setLayoutParams(tl.getLayoutParams());
                        (tv = new 
TextView(this)).setLayoutParams(tr.getLayoutParams());
                        tv.setText("Name: "+ac.name);
                        tr.addView(tv);
                        tl.addView(tv);
                }
      }

I've also tried:

        private void populateData(AndroidContact ac)
        {
                TableLayout tl = (TableLayout)findViewById(R.id.view_contact);

                TableRow tr = null;
                TextView tv=null;
                if (ac.name!=null)
                {
                        (tr = new TableRow(this)).setLayoutParams(new
TableLayout.LayoutParams());
                        (tv = new TextView(this)).setLayoutParams(new
TableLayout.LayoutParams());
                        tv.setText("Name: "+ac.name);
                        tr.addView(tv);
                        tl.addView(tv);
                }
      }


I don't understand anymore... *sigh*.


--~--~---------~--~----~------------~-------~--~----~



TableLayout layout params

by kingkung » Wed, 07 May 2008 18:40:41 GMT


 Never mind, I just used a vertical LinearLayout... much less prone to
restrictions IMHO.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Can I flash HTC Hero?

Hi;

I want to learn whether I can flash HTC Hero or not like Android Dev Phone?
That is, does HTC Hero have same hardware with Android Dev Phone without
SIM-lock and hardware lock?

Thanks

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

2. Share worldlists across different IMEs

Afaik, each IMEs must provide its own worldlist for word completion.
This is a waste of time for developers and of disk space.

Is it possible to use a wordlist that is shared across the IMEs?
Does this exist already?

Thank you.

--

3. Rate cool ideas to win an Android phone

4. GSM Timing Advance

5. Don't forget guys ! Tomorrow is the day Orange will launch the new Orange App Shop on-device client, at LeWeb09 in Paris...

6. Problem with Search By Voice on Motorola Milestone

7. How to Add Objects to Sqlite Database