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. How to disable home and other buttons so as to persist an app?

Hi,

Thanks Mr Romain Guy, for the information.

@Mike dg : The requirement is that one app has to be loaded at startup which
displays a browser with a specified URL. And one of the requirement is that
whatever buttons the user presses or clicks, the browser shouldn't exit. The
browser with the specified URL should be the only app that the user has
access to.

Since the 'Home' button on being pressed, exists the application, the above
requirement can't be implemented.






Ashok Jeevan
+91 9895401278







> > 

2. Multi Touch - Does anyone know how it works

Do you guys know if this is why the bug that many game developers have come
across occurs.. where trying to simulate two joysticks on the screen wont
work due to wrong touch info being consumed? I forget the details, but I
think it had to do with if you touch one point, and while doing so, touch
another..that works fine.. but if you release point 1, then touch again, it
some how reads as point 2, instead of point 1? Was this issue resolved due
to what you said above niko.. that multi-touch only works within one view? I
would have thought a game would use a single view as well tho.






> > 

3. Flash to JC4

4. Dibutuhkan Blackberry, Brew, Android, Iphone dan/atau J2ME Developer

5. Flash on Nexus kereeennn

6. japri : wta blitz Yahoo Messenger :-)

7. How to detect if the soft keypad is up or down