Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    LayoutParams
    open class LayoutParams : ViewGroup.LayoutParams
    
    AbsListView extends LayoutParams to provide a place to hold the view type.
    Summary
    
      
        
          | Inherited XML attributes | 
        
        
          
            From class LayoutParams
              
                
                  
                    android:layout_height | 
                    
                       Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants. 
                         May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).  
                        Must be one of the following constant values. 
 
                            
                          
                            
                              | Constant | 
                              Value | 
                              Description | 
                             
 
                            
                              | fill_parent | 
                              ffffffff | 
                              The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent. | 
                             
 
                            
                              | match_parent | 
                              ffffffff | 
                              The view should be as big as its parent (minus padding). Introduced in API Level 8. | 
                             
 
                            
                              | wrap_content | 
                              fffffffe | 
                              The view should be only big enough to enclose its content (plus padding). | 
                             
 
                         
                      
                     | 
                   
                  
                    android:layout_width | 
                    
                       Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants. 
                         May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).  
                        Must be one of the following constant values. 
 
                            
                          
                            
                              | Constant | 
                              Value | 
                              Description | 
                             
 
                            
                              | fill_parent | 
                              ffffffff | 
                              The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent. | 
                             
 
                            
                              | match_parent | 
                              ffffffff | 
                              The view should be as big as its parent (minus padding). Introduced in API Level 8. | 
                             
 
                            
                              | wrap_content | 
                              fffffffe | 
                              The view should be only big enough to enclose its content (plus padding). | 
                             
 
                         
                      
                     | 
                   
                
               
             
           | 
        
      
    
    
      
        
          | Inherited constants | 
        
        
          
            From class LayoutParams
              
                
                  
                    Int | 
                    FILL_PARENT
                      
                         Special value for the height or width requested by a View. FILL_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. This value is deprecated starting in API Level 8 and replaced by MATCH_PARENT. 
                      
                     | 
                   
                  
                    Int | 
                    MATCH_PARENT
                      
                         Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8. 
                      
                     | 
                   
                  
                    Int | 
                    WRAP_CONTENT
                      
                         Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account. 
                      
                     | 
                   
                
               
             
           | 
        
      
    
    
    
    
    Public constructors
    
    
    
      LayoutParams
      
      LayoutParams(
    w: Int, 
    h: Int)
     
    
      LayoutParams
      
      LayoutParams(
    w: Int, 
    h: Int, 
    viewType: Int)
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]