Socials
  • Facebook
  • Instagram
  • Linkedin
  • Youtube
  • Stackoverflow
  • Github
  • AngelList

Igor Khrupin

  • About
  • Technical Blog
  • Archives

XML

Android Development

How to set View width (height) in percentage of parent View in Android

Example:I want to set child LinearLayout height = 50% of parrent LinearLayout in Android. Like in HTML. To set height in percents I do some trick with android:layout_weight and android:weightSum Here the screenshot: To do this you need do somethind like this. Look at code below:

By Igor Khrupin, 15 years29 February, 2012 ago
profile for ihrupin at Stack Overflow, Q&A for professional and enthusiast programmers
Categories
  • Algorithms (7)
    • Graph (1)
    • Linked List (2)
    • Searching (1)
    • Sorting (3)
  • Frameworks (4)
    • Flash (4)
  • Gradle (1)
  • Integrated development environment (IDE) (8)
    • Android Studio (8)
  • Mobile Software Development (75)
    • Android Development (74)
      • Android Accessibility (1)
      • Android NDK (3)
      • Android Performance (1)
    • iOS Development (2)
  • Operation Systems (28)
    • Linux (16)
      • Ubuntu (6)
    • Mac OS X (13)
      • Mountain Lion (2)
  • Programming Languages (10)
    • ActionScript (3)
    • Java (7)
  • Tech (112)
  • Tools (1)
  • Uncategorized (1)
  • Web Development (16)
    • Bots (1)
Tags
ActionScipt 3 Activity Algorithm Android Android Keyboard Android SDK Android Studio cron crontab Decomposition Eclipse embed Font Flash UI Google maps Google Maps V2 hammerhead hotkeys HTML iOS LatinIME Layout letsencrypt Linux Ubuntu ListView LoaderManager Lucid Lynx Mac OS X Map Overlays Maven media player MySQL NDK nginx opacity PHP Recursion Sorting ssl Telephony TextField Ubuntu UI View ViewPager Virtual Machine
Categories

Hestia | Developed by ThemeIsle