Set attributes (margin, gravity, etc...) to an Android view programmatically (without XML).
        Posted  
        
            by thom
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by thom
        
        
        
        Published on 2010-04-27T07:26:43Z
        Indexed on 
            2010/04/27
            7:33 UTC
        
        
        Read the original article
        Hit count: 519
        
I need to create a GUI (layout+views) in my .java activity class (I know it's far more flexible and easier to use .xml layout file, but I don't want to use it for now).
I can't find any setGravity() (but a "Gravity" object I can't figure how to use) or any set setMargin() method for the "View" object.
What is the easiest way to do it ?
Thanx.
© Stack Overflow or respective owner