首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

grid常用设置

父元素 1.dispaly: grid | inline-grid | subgrid; grid: 生成块级网格 inline-grid: 生成行内网格 subgrid: 如果网格容器本身是网格项(嵌套网格容器),此属性用来继承其父网格容器的列、行大小 2.grid-template-columns 行大小 grid-template-rows 列大小 3.单元格间距grid-column-gap、 grid-row-gap、grid-gap grid-column-gap: 单元格列间距 grid-row-gap:单元格行间距 grid-gap:grid-row-gap 和 grid-column-gap的简写 4. 单元格内容宽度和左右对齐:justify-items: stretch | start | center | end; 5. 单元格高度和上下对齐align-items: stretch|start | end | center ; start: 左对齐 end: 右对齐 center: 居中对齐 stretch: 填满(默认,内容居左) 6.总网格区域相对于容器左右对齐方式(网格内容大小小于容器宽时) justify-content: start | end | center | stretch | space-around | space-between | space-evenly ; 7. 总网格区域相对于容器上下对齐方式(网格内容大小小于容器高时) align-content: start | end | center | stretch | space-around | space-between | space-evenly ; start: 左对齐 end: 右对齐 center: 居中对齐 stretch: 填满网格容器 space-around: 网格项两边间距相等,网格项之间间隔是单侧的2倍 space-between: 两边对齐,网格项之间间隔相等 space-evenly: 网格项间隔相等

01

LayoutParams 简单理解[通俗易懂]

大家好,又见面了,我是你们的朋友全栈君。 简单说说 自己对 android LayoutParams的理解吧。 public static class ViewGroup.LayoutParams extends Object java.lang.Object ↳ android.view.ViewGroup.LayoutParams //继承关系 以下说明摘自官方文档E文好的可以看看 Class Overview LayoutParams are used by views to tell their parents how they want to be laid out. See ViewGroup Layout Attributes for a list of all child view attributes that this class supports. The base LayoutParams class just describes how big the view wants to be for both width and height. For each dimension, it can specify one of: FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding) WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding) an exact number There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value. E文不好看不懂 但是觉得写得啰嗦了 其实这个LayoutParams类是用于child view(子视图) 向 parent view(父视图)传达自己的意愿的一个东西(孩子想变成什么样向其父亲说明)其实子视图父视图可以简单理解成 一个LinearLayout 和 这个LinearLayout里边一个 TextView 的关系 TextView 就算LinearLayout的子视图 child view 。需要注意的是LayoutParams只是ViewGroup的一个内部类 这里边这个也就是ViewGroup里边这个LayoutParams类是 base class 基类 实际上每个不同的ViewGroup都有自己的LayoutParams子类 比如LinearLayout 也有自己的 LayoutParams 大家打开源码看几眼就知道了 myeclipse 怎么查看源码 请看 http://byandby.iteye.com/blog/814277 下边来个例子

03
领券