android测量的三种模式
生活随笔
收集整理的這篇文章主要介紹了
android测量的三种模式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
測量模式有三種引用官方的解釋如下
UNSPECIFIED?
The parent has not imposed any constraint on the child. It can be whatever size it wants.
父View沒有對自定義View的大小做任何限制,自定義View想多大就多大,但是不能超過父View的大小
EXACTLY?
The parent has determined an exact size for the child. The child is going to be given those bounds regardless of how big it wants to be.
父View給自定義View確定了一個范圍,在這個范圍內,自定義view的大小是給出的具體的值,比如 width =100dp,height=200dp,但是如果給出的任何一個數值超過了父View的限制值,他最大是父View的限制值
AT_MOST?
The child can be as large as it wants up to the specified size.
父View沒有對自定義控件做任何限制,想多大就多大,可以超過父View的大小,
轉載于:https://www.cnblogs.com/Oldz/p/11230819.html
總結
以上是生活随笔為你收集整理的android测量的三种模式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: flutter依赖某些插件,点击运行会出
- 下一篇: Android巩固之事件分发机制