Scale images in different Devices Android Studio - android

I am making a Tic Tac Toe application for fun in Android Studio and have a problem.If i use nexus5x for preview in layout editor my app is oriented perfect.If i change this to nexus4 or a tablet the orientation is messed up.
This is a picture of what i mean.
Nexus 5x as preview and Nexus 4 as preview
A sample from my xml code is the below:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.mpampis.tictactoe2.MainActivity">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:background="#drawable/board"
android:columnCount="3"
android:rowCount="4">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView3"
android:layout_row="0"
android:layout_column="2"
android:src="#drawable/kokkinov3"
android:layout_marginTop="25dp"
android:layout_marginLeft="20dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView2"
android:layout_row="0"
android:layout_column="1"
android:src="#drawable/kokkinov3"
android:layout_marginTop="25dp"
android:layout_marginLeft="30dp"/>

As I saw your images they are receiving wrong margins, i.e. smaller screen receiving the larger margins which are suitable for nexus 5. As you have hardcoded the margins for every screen size, which is not recommended. try to put your margins in dimension.xml and make another for smaller screen.
Well the whole point of using DP is so that you don't have to worry about this. Margins will be roughly the same across devices, but if you're relying on lining things up on one particular device resolution/density combination, you'll definitely be in for a surprise when you test on other devices.
That said, if you do need to specify different margins for different screen sizes, simply add an XML file in res/values -- something like dimens.xml:
<resources
xmlns:android="http://schemas.android.com/apk/res/android"
>
<dimen name="my_view_margin">10dip</dimen>
</resources>
Then add one of these XMLs for every specific device qualifier that you need to (e.g. values-large, values-sw600dp, values-xlarge, etc.) and modify the value as you see fit. When you want to use these dimensions in a layout, just use:
android:layout_margin="#dimen/my_view_margin"
And Android will pick the correct value for whatever device it happens to be running on.

Nexus 4 is 384dp wide, and Nexus 5X is 411dp wide, according to this.
When I had to make app with grid layout, I manually calculated each item's dimensions and added some padding for spacing.
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
int itemWidth = width / 3;

Perhaps the Percent Support Library could assist you in this.
It allows you to set LayoutParams as percentages instead of as hard values.

Related

TextView getting cut in some resolutions

I have a RecyclerView which consists of CardViews that have a TextView and an ImageView, among some other layouts.
The problem is, in some screen resolutions the TextView gets cut off or shoved to the next line, which I don't want.
In other resolutions, the TextView has plenty of room.
Small Resolutions:
High Resolutions:
How do I organize the layout so that there is enough room for the TextView, and the ImageView will be sized accordingly?
This is my xml for the RecyclerView items:
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:id="#+id/zmanCard"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
cardview:cardUseCompatPadding="false"
cardview:cardPreventCornerOverlap="false"
cardview:cardCornerRadius="4dp"
cardview:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="top"
android:gravity="center"
android:orientation="vertical"
android:background="?attr/colorPrimaryDark">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/zmanCardTitle"
android:textColor="#ffffff"
android:gravity="center"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="4dp"
android:alpha="0.8"
android:id="#+id/zmanCardImage" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="4dp">
<TextView
android:text="5:40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:id="#+id/zmanCardTime"
android:textColor="#ffffff"
android:textSize="18sp" />
<ProgressBar
android:id="#+id/zmanProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="top|left"
style="#style/Base.Widget.AppCompat.ProgressBar" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
Try this. Works 100%.
AutoResizeTextView or sdp unit can help you.
SDP - a scalable size unit
An android SDK that provides a new size unit - sdp (scalable dp). This size unit scales with the screen size. It can help Android developers with supporting multiple screens.
for text views please refer to ssp which is based on the sp size unit for texts.
https://github.com/intuit/sdp
Auto Scale TextView Text to Fit within Bounds
And if you want support different layout designs for different screen:
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
Fore more information look here
A TextView that automatically resizes text to fit perfectly within its bounds.
Usage:
dependencies {
compile 'me.grantland:autofittextview:0.2.+'
}
Enable any View extending TextView in code:
AutofitHelper.create(textView);
Enable any View extending TextView in XML:
<me.grantland.widget.AutofitLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
</me.grantland.widget.AutofitLayout>
Use the built in Widget in code or XML:
<RootElement
xmlns:autofit="http://schemas.android.com/apk/res-auto"
...
<me.grantland.widget.AutofitTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:maxLines="2"
android:textSize="40sp"
autofit:minTextSize="16sp"
/>
Reference Link : https://github.com/grantland/android-autofittextview
I can suggest two step solution one for your text size so with wrap_content attribute it gets fit to text and I suggest using a qualifier to provide several alternative layouts to target different screen configurations. You do so by using configuration qualifiers, which allows the run-time to automatically select the appropriate resource based on the current device’s configuration (such as a different layout design for different screen sizes). Supporting Different Screen Sizes
from this part till the end i copied my answer from this link from #Herry's answer:
I think you need to check this Google IO Pdf for Design. In that pdf go to Page No:77 in which you will find how there suggesting for using dimens.xml for different devices of android for example see below structure:
res/values/dimens.xml
res/values-small/dimens.xml
res/values-normal/dimens.xml
res/values-large/dimens.xml
res/values-xlarge/dimens.xml
for Example you have used below dimens.xml in values.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="text_size">18sp</dimen>
</resources>
In other values folder you need to change values for your text size.
for example:
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="font_size_small">10sp</dimen>
<dimen name="font_size_medium">20sp</dimen>
<dimen name="font_size_large">30sp</dimen>
</resources>
If you want scalable screens, You shouldn't use fixed height or width as much as possible. In your case, you should place your components proportionately with layout_weight.
For more details;
What does android:layout_weight mean?
For more simple way create your layout using relative layout with some proper technic sure it will resolve. if still haveing issue ask me for .xml file
You should use padding so that textview always has some fixed padding and it never gets cut.
In your code make following changes
<TextView
android:text="5:40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:id="#+id/zmanCardTime"
android:textColor="#ffffff"
android:padding:"3dp"
android:textSize="18sp" />
I think you should not fix the spanCount of GridLayout. It would be better if for high resolutions you will display 4 items, for small resolutions you display 3 items, for landscape display 5 items, ...
To do that you should create a constants for all values folder that you will support like
res/values-small/dimens.xml
constants.xml
res/values-large/dimens.xml
constants.xml
for each constants.xml, it will look like
<resources>
<integer name="span_count">3</integer>
</resources>
Then when you create GridLayoutManager
GridLayoutManager lm = new GridLayoutManager(Context context, getContext().getResources().getInteger(R.integer.span_count));
After you do like this, your problem will not happend
try giving weight to the textview layout and imageview layout give weight 1 to both layouts
Use AutoScaleTextView
The AutoScaleTextView takes the android:textSize value and uses it as the preferred text size. You can also set the minimum text size. The default for the minimum text size is 10dp. The AutoScaleTextView now tries to take the maximum value between the preferred and minimum size that fits into the Views width (with regarding the padding).
Please find full AutoScaleTextView class and its implementations in below LINK
http://ankri.de/autoscale-textview/
Here you go again 2nd time with the key word
Resolution
What are the options you have in hand now?
Supporting Multiple Screens
1 Multiple layouts 2.Multiple dimens
Famous Answer on this particular question (Auto Scale Text-view Text to Fit within Bounds)
Usage of Weight_sum attribute
GitHub Libraries like AutoFitTextView , SDP
Just summarized those answers(All-in-one)! any other options left?
As I can see your problem is bound with two hand in hand cases.
Of course your text does not resize 2.Your layout is too much flexible.
See sometimes TextView itself go down.Any other options that you can try to avoid this, instead of your solutions that you have?
PercentRelativeLayout
Any extra advantage of this ? Yes, this supports percentage based dimensions and margins,You have set fixed margins and this will give you them using a percentage.It even have a cool attribute called layout_aspectRatio. Here is a link for a small tutorial.
Give sizes based on ratio / absolute position of a view
Before PercentRelativeLayout I mostly used this.First you need to have a model image/sketch of your view.
My model is with 1920 px in height and 1080 in width (Normally its an HDTV resolution,16:9 aspect ratio)
In that image we know where the views are positioned.
Then for any view/any other screen I can use the same ratio to position them using LayoutParams. Now view stays according to your rules.
Here is an example:
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
height = displaymetrics.heightPixels;
width = displaymetrics.widthPixels;
LinearLayout.LayoutParams topLenP= new LinearLayout.LayoutParams(300 * width / 1080, 400 * width / 1920);
//topLenP.topMargin = x* height / 1920;
//topLenP.leftMargin = y* width / 1080;
myView.setLayoutParams(topLenP);
What actually I did here,as I said in my model view this view took 300 width , 400 in height,with this I am adjusting that same ratio for my currant screen.(using currant screen size).
Moving back to auto scaling since now we have a same ratio based view here is another good answer.
Auto-fit TextView for Android
android:textAppearance
Finally there are fixed sizes given in the android \platforms\android-X\data\res\values\themes.xml based on small, large and medium.
Without specifying what you exactly need you can also use it as
<TextView
android:textAppearance="?android:attr/textAppearance"
....
/>
Hope this helps!
Solution 1
https://developer.android.com/guide/practices/screens_support.html
// The TEXT SIZE in dp
private static final float TEXT_SIZE_DP = 16.0f;
// Get the screen's density scale
final float scale = getResources().getDisplayMetrics().density;
// Convert the dps to pixels, based on density scale
int textSize = (int) (TEXT_SIZE_DP * scale + 0.5f);
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,textSize);
Solution 2:
float dpi = getResources().getDisplayMetrics().widthPixels;
dpi = dpi / 320;
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,TEXT_SIZE_DP*dpi);
How its Work refer below link
http://canvasonandroid.blogspot.in/2016/04/how-to-scale-font-size-for-different.html
Note: It will work only on the device, not on the tablet. we need to write different logic for the tablet. for this you need to set font size in dimen.xml
My experience in android I always use dp instead of sp, so u fix the dp value for all your textviews and will fit anyscreen.
Let me know if any issue.
Best Regds

How it works that XML show all on display?

How it works, that android show me all boxes on display, whatever I have a 4" Display or a 7" Display? It's okay, that android show the boxes a little bit smalls, but I must have all the boxes on display.
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:background="#drawable/box_ressourcen">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/box"
android:id="#+id/box1"
android:showDividers="beginning"
android:layout_gravity="top"
android:layout_alignParentStart="true"
android:layout_alignParentTop="false"
android:layout_below="#+id/imageView"
android:layout_marginTop="-20dp"
android:layout_alignParentEnd="false"
android:gravity="center">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/myimage1"
android:src="#drawable/inventar"/>
</LinearLayout>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:layout_alignParentStart="false"
android:src="#drawable/inventar_ressourcen"
android:layout_marginTop="-25dp" />
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/box"
android:id="#+id/box2"
android:showDividers="beginning"
android:layout_gravity="top"
android:layout_alignTop="#+id/box1"
android:layout_toEndOf="#+id/box1"
android:gravity="center">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/imageView2"
android:src="#drawable/inventar" />
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/box"
android:id="#+id/box3"
android:showDividers="beginning"
android:layout_gravity="top"
android:layout_alignTop="#+id/box2"
android:layout_toEndOf="#+id/box2"
android:gravity="center">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/imageView3"
android:src="#drawable/inventar" />
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/box"
android:id="#+id/box4"
android:showDividers="beginning"
android:layout_gravity="top"
android:gravity="center"
android:layout_alignTop="#+id/box3"
android:layout_toEndOf="#+id/box3">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/imageView4"
android:src="#drawable/inventar" />
</LinearLayout>
</RelativeLayout>
And how I can change it, that the boxes was show in a line and break on the end of the line and go to the next line?
Example:
MyBoxes:
B1 B2 B3 B4 B5 B6 B7 B8 B9 B10
Display:
B1 B2 B3 B4
B5 B6 B7 B8
B9 B10
It depends with the sizes of your Views.
Its up to you to decide that you are going to show everything in the screen size or you let it to scroll in the screen.
You can divide your screen using XML , code or using both.
If you want you can go for flexed sizes (width / height) or wrap it and when you wrap it ,it will take the height of its child/children or you can separate layouts with a ratio again using XML ,code or both.
read about weight_sum and layout_weight
also how to give sizes to layouts based on the screen size
What is android:weightSum in android, and how does it work?
https://developer.android.com/training/multiscreen/screensizes.html
https://developer.android.com/guide/practices/screens_support.html
https://developer.android.com/training/multiscreen/screendensities.html
easiest one for you at this stage will be this
https://stackoverflow.com/a/12302811/5188159
also read about how to set sizes based on screen size which will display your XML in the same way in any screen
simple math - allocate my layout height 10% from the screen so the size will keep the ratio in any kind of a screen
as a code snippet this will give you the screen size height and width for the latest visions of android
DisplayMetrics displaymetrics = new DisplayMetrics();
this.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
now you can set a size problematically using the ratios
To learn it you can search ;) i'm not telling you that :) and good luck!
For each size you should make a different layout, in order to do that you create another layout with the same name that the one you already have but you add a qualifier like this :
You click on size and choose the one you want. Do this for each size (sall, normal, large, X-Large) and it should be ok.
From the way you speak it is clear that you miss the theorical part.
Basically you have to do different layout for the major configurations you could need, in your case one basic one like you did it and then if I well understand one for smaller screens, in your case 4 inches. To understand how you should name them i would warmly recommend you to go trought he documentation for inches is considered a normal screen that are at least 470dp x 320dp
In particular I suggest you this passage, where is explained also why is not best practice to call the four inches screen as normal
Provide different layouts for different screen sizes
By default, Android resizes your application layout to fit the current
device screen. In most cases, this works fine. In other cases, your UI
might not look as good and might need adjustments for different screen
sizes. For example, on a larger screen, you might want to adjust the
position and size of some elements to take advantage of the additional
screen space, or on a smaller screen, you might need to adjust sizes
so that everything can fit on the screen.
The configuration qualifiers you can use to provide size-specific
resources are small, normal, large, and xlarge. For example, layouts
for an extra-large screen should go in layout-xlarge/.
Beginning with Android 3.2 (API level 13), the above size groups are
deprecated and you should instead use the swdp configuration
qualifier to define the smallest available width required by your
layout resources. For example, if your multi-pane tablet layout
requires at least 600dp of screen width, you should place it in
layout-sw600dp/. Using the new techniques for declaring layout
resources is discussed further in the section about Declaring Tablet
Layouts for Android 3.2.
This is a basic skill every Android developer should know, so I would highly recommend you to learn how it works.

dip is not stretching properly according to screen resolutions in android phones

I have used dip(eg: width = 30dip, scroll bar till the middle of screen) , as parameter But in 3.5 inches phone it looks fine, in 5 inches screen phones its not at all coming till middle, here goes below middle. why?
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="450dip"
android:paddingLeft="10dip">
<ImageView
android:id="#+id/gdi_arrow_up"
android:layout_width="27dip"
android:layout_height="27dip"
android:layout_marginLeft="10dip"
android:scaleType="fitCenter"
android:layout_marginBottom="-8dip"
android:src="?attr/asListArrowUp" />
<include layout="#layout/main_menu"/>
<ImageView
android:id="#+id/gdi_arrow_down"
android:layout_width="27dip"
android:layout_height="27dip"
android:scaleType="fitCenter"
android:layout_marginBottom="-8dip"
android:layout_below="#android:id/list"/>
</RelativeLayout>
dip stands for density independent pixel, this means 2 screens with the same size but different density will treat that value the same, however 2 screens of different size (large vs normal) will treat the value differently.
your 5 inch phone may be reported as large and your 3.5 inch phone as normal causing the issue but I'm not sure.
also in your realative layout I'd recommend using match_parent for the height, you usually will not use set widths for viewGroups.
Set the LayoutParameters of the RelativeLayout dynamically as screenWidth/2..it will work on all devices..
In your onCreate do something like this:-
RelativeLayout rel = (RelativeLayout) findViewById(R.id.rel1);
int screenHeight = getWindowManager()
.getDefaultDisplay().getHeight();
rel.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, screenHeight/2));
Hope this helps.

Tool/way to preserve handset layout proportions on tablet devices

Here's an example layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:text="#string/hello_world" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="#drawable/ic_launcher" />
</RelativeLayout>
On a handset(480x800) and a tablet(1280x800) the layout has different amount of space left from the imageview to the bottom. The image isn't scaled on the tablet and dp values result in relatively same physical values.
Is there a way/tool to save handset proportions for tablets so that images, spaces(dp) get scaled? I guess, I could use values-xlarge/dimen.xml, values-720dp/dimen.xml, but it's a lot of mechanical job to. Any better solution ?
If you want to adjust scaling of ImageView
add
android:scaleType="fitXY"
Here are the ImageView Scale types
http://developer.android.com/reference/android/widget/ImageView.ScaleType.html
Try this:
<LinearLayout
:
:
android:focusable="true"
:
/>
If you want your app to be 2 times bigger (all dimentions and font sizes x2) on 2 times larger dispay you can manually change display density (reduce it in a half). Android wont mind and will work as usual. I use this trik when I want my app to be the same and only change scale depending on screen size. Read about Configuration/DisplayMetrics/updateConfiguration. Here is draft code you should run in activity's onCreate. I give you exact code later.
DisplayMetrics dm = context.getResources().getDisplayMetrics();
// fix display density here to scale all activity's dimentions
context.getResources().updateConfiguration(null, dm);
But it isn't proper android way. You should provide different resources for different screen sizes using appropriate resourse folders.

Is it true that when coding for android 360dp = the whole screen width?

It seems like that for me, on my virtual android device.
If this isn't the case, then how can I specify eg. 35% of the screen width, without using 360*.35 = 126dp?
Is it true that when coding for android 360dp = the whole screen width?
No.
It seems like that for me, on my virtual android device.
It is not "the whole screen width" for any standard Android screen resolution that I can think of. For example, 360dp = 360px for medium density screens and 540px for high-density screens, and I know of precisely zero Android devices with 360px or 540px in either dimension.
Also, bear in mind that "the whole screen width" will vary depending upon whether the device is in portrait or landscape mode.
If this isn't the case, then how can I specify eg. 35% of the screen width, without using 360*.35 = 126dp?
Use a LinearLayout and android:layout_weight. Here is a sample project demonstrating this. The key is in the layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:text="Fifty Percent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="50"
/>
<Button
android:text="Thirty Percent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="30"
/>
<Button
android:text="Twenty Percent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="20"
/>
</LinearLayout>
Each widget is denoted as having no intrinsic height, so the total height is divided up among the widgets based on their relative weights.

Categories

Resources