There are a lot of options to help you position your Views just right. But adding a LinearLayout to your beautiful RelativeLayout just to gain access to layout_weight for that perfect positioning is ridiculous. And we hear you on that. Which is why Android introduced the new Percent Support Library (https://goo.gl/XTOD5G). Its PercentFrameLayout and PercentRelativeLayout provide an easy way to specify View dimensions and margins in terms of a percentage of the overall size.
That means if you want a view to take up exactly 50% of the available width and height, you’d use a layout such as
Note that we use layout_marginStartPercent/EndPercent to set a margin based on a percentage of the total width.
Fun fact: if the percentage you set is more of a guideline than hard limit, you can also set layout_width/height=”wrap_content” in addition to layout_widthPercent/heightPercent and Views larger than the allowed percentage value will instead be resized using wrap_content rules.
So check out the Percent library today and use this efficient layout to #BuildBetterApps
Microsoft invited me to their Redmond campus in Seattle to talk about being an Android developer and the tools I use everyday.
I'll be there from Saturday afternoon until Tuesday morning. If any local #androidevs want to meetup, let me know!
- Car-Part.comSales, 5 - present
- Northern Kentucky UniversityComputer Information Technology, 2012 - present
- University of LouisvilleComputer Information Systems, 2010 - 2012
- Kingdom Rush Origins
- Monument Valley
- Angry Birds Under Pigstruction
- You Must Build A Boat
- Super Hexagon
- Fallout Shelter
- Star Wars™:KOTOR
CSC 456/556 Fall 2015 - Android Apps on Google Play
Want to know what material is being covered this week? What were the badges again? Did I miss the deadline for that adventure? Fear no more!
Batterii Mobile (beta) - Android Apps on Google Play
Batterii Desktop leverages the Creative Process to inspire employees, create new ideas and solve problems across the Enterprise. Through uns
Bouncing Isaac: Watch Face - Android Apps on Google Play
Bouncing Isaac uses the built-in sensors on your watch to display playful, interactive, geometric patterns and colors that change throughout
Valiant Hearts: The Great War – Android-Apps auf Google Play
Tauche ein in die ergreifende Geschichte von vier unbekannten Helden inmitten des ersten Weltkriegs, in einer einzigartigen interaktiven Gra
You Must Build A Boat - Google Play'de Android Uygulamaları
You Must Build A Boat is the sequel to the award winning "10000000" "Makes the original game feel like a demo. It's absurdly fun and nearly
FINAL FANTASY TACTICS : WotL - Android Apps on Google Play
Final Fantasy Tactics: The War of the Lions has arrived for GooglePlay!Released as the Final Fantasy series' first tactical RPG in 1997, Fin
Troll Watch Face – Applications Android sur Google Play
U MAD BRO? U MAD BRO?
ustwo Smart Watch Faces - Android Apps on Google Play
Our smart watch faces integrate calendar and weather information so you can see at a glance when your next appointment is, how busy/free you