1. Download our Official Android App: Forums for Android!

Apps Setting Weight in Java code

Discussion in 'Android Development' started by StevenTNorris, May 14, 2010.

  1. StevenTNorris

    StevenTNorris Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    May 14, 2010

    May 14, 2010
    2
    0
    5
    I have created a view that extends a LinearLayout and added a few children for it (mostly textViews). I want to set the weight (and possibly other attributes) of these children, but do not know how to do this unless I use xml.

    Is there a way to set the weight in java code?

    or

    Is there a way to set the children of the linearlayout in my class using xml?
     

    Advertisement

Share This Page

Loading...