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. ReplayGain

Hi all,

Does anybody know anything about getting ReplayGain support on
android? I've grepped the source and googled but can't find any
mention of it.

I guess it should be added to opencore, but maybe it could be done in
the Music app as well. I consider it an essential feature of any
portable music player, but maybe that's just me.

cheers,
Craig
--~--~---------~--~----~------------~-------~--~----~

2. IMX31 Touch Screen problem

Hail to all experts,

I'm trying to get the touch screen working on IMX31 3 stack boards. At
"kernel/drivers/input/touchscreen/mxc_ts.c" placed printf to test the
touchscreen respond/coordinate input.

Well I notice the output x-coor is inverted, everything else looks
fine.
Kernel is reading the input, but not the Android OS.

I tried the suggestion of:

3. 3g frecuency

4. Data Synchronization Option is missing from the Settings!!!

5. how to run sample application in real harware

6. Manipulate setting "send caller id"

7. Tutorial ( Programming Network Engineering Mobile and ...moooore )