You need to create a LayoutParams the corresponds to the actual class of the
parent, such as FrameLayout.LayoutParams.

On Sun, Apr 5, 2009 at 10:30 PM, Desu Vinod Kumar <[email protected]>wrote:

> May We can use like this
>
> TextView tv = new TextView(this);
>
> tv.setLayoutParams(new
> ViewGroup.layoutParams(LayoutParamas.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
>
> try this
> in java
> i think......
>
> On Sat, Apr 4, 2009 at 1:25 PM, DaRolla <[email protected]>wrote:
>
>>
>> Hi,
>>
>> I need to programm this XML in JAVA. Some I figured out, some not. Can
>> you help me on the missing ones?
>>
>>
>> <TextView android:layout_width="150px"
>>  android:layout_height="wrap_content"
>>  android:text="Bladidadi"
>>  android:layout_gravity="center_vertical"
>>  android:textColor="#ffffff" />
>>
>>
>> TextView tv = new TextView(this);
>>
>> //android:layout_width="150px"
>> tv.setWidth(150);
>>
>> //android:layout_height="wrap_content"
>> ???
>>
>> //android:text="Bladidadi"
>> tv.setText("Bladidadi");
>>
>> //android:layout_gravity="center_vertical"
>> tv.setGravity(Gravity.CENTER_VERTICAL);
>>
>> //android:textColor="#ffffff"
>> tv.setTextColor(Color.rgb(0xff, 0xff,0xff));    // tv.setTextColor
>> (0xffffff) doesn't work somehow
>>
>>
>> Greetings,
>> DaRolla
>>
>>
>
>
> --
> Regards
> -------------------
> Desu Vinod Kumar
> [email protected]
> 09916009493
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to