TreKing

  Thanks for responding

   I think I didn't understand your question correctly. the project file is 
attached. The following is what I am doing.

         int result_str_size = 5;
            for ( int i=0 ; i< result_str_size; i++)
            {
                        TableRow tr = new TableRow(this);
                        String result_str="Hello | World | this is | fun";
                        tr.setLayoutParams(new LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
                        tr.setMinimumHeight(20);

                        tr.setPadding(10, 2, 10, 2);
                        TextView id = new TextView(this);


                        id.setBackgroundColor(0x55779900);

                        id.setText(""+(i+1)+"");
                        tr.addView(id);
                        StringTokenizer st = new 
StringTokenizer(result_str,"|");

                        int back_color=0xFFFF9900;

                        while (st.hasMoreElements())
                        {
                                back_color+=0x40;
                                TextView name = new TextView(this);

                                name.setBackgroundColor(back_color);

                                String token = st.nextToken();
                                name.setText(token);

                                tr.addView(name);
                        }

                        tl1.addView(tr);
            }


On Tuesday, 13 August 2013 10:33:04 UTC+5:30, TreKing wrote:
>
>
> On Mon, Aug 12, 2013 at 9:37 PM, Salil <sal...@gmail.com <javascript:>>wrote:
>
>> I want to get the first column shrink to fit to the text size.
>
>
> And what have you tried?
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago 
> transit tracking app for Android-powered devices
>  

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to