- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _masonryViewArray = [NSMutableArray array]; ; i<; i++) { UIView *view = [[UIView alloc] init]; view.backgroundColor = [UIColor redColo…
1.获取手机屏幕宽高: DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int screenWidth = dm.widthPixels; int screenHeight = dm.heightPixels; 22.根据屏幕宽度为控件设置动态设置宽高: imageView.setImageResource(R.drawable.newscar); L…
经常会看到QQ上面有一个 消息和电话 的顶部面板,这个空间是IOS7的分段控制,android中没有这个控件,今天在威哥的微信公众号中成功gank到这个自定义控件的实现,下面跟着尝试一波. 首先是定义文字的颜色,在res/color下新建segment_text_color_selector.xml文件 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http…
const AspectRatio({ Key key, @required this.aspectRatio, Widget child,}) void main() {  runApp(    new MaterialApp(      title: 'Demo',      home: new Scaffold(        appBar: new AppBar(          title: new Text('Demo'),       ),        body: new Ce…
一,概述 Flutter中拥有30多种预定义的布局widget,常用的有Container.Padding.Center.Flex.Row.Colum.ListView.GridView.按照<Flutter技术入门与实战>上面来说的话,大概分为四类 基础布局组件:Container(容器布局),Center(居中布局),Padding(填充布局),Align(对齐布局),Colum(垂直布局),Row(水平布局),Expanded(配合Colum,Row使用),FittedBox(缩放布局)…
一.先解释相关API 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /**  *  distribute with fixed spacing  *  *  @param axisType     横排还是竖排  *  @param fixedSpacing 两个控件间隔  *  @param leadSpacing  第一个控件与边缘的间隔  *  @param tailSpacing  最后一个控件与边缘的间隔  */ - (void)mas_di…
ElegantSnap ElegantSnap(Base on SnapKit) to make Auto Layout easy and elegant on both iOS and OS X. 基于SnapKit, 用法简洁优雅,可运行在iOS.tvOS.macOS上自动布局库 Requirements / 使用条件 iOS 10.0+ / Mac OS X 10.12+ / tvOS 10.0+ Xcode 10.2+ Swift 5.0+ Installation / 安装 Cocoa…
博客地址 : http://blog.csdn.net/shulianghan/article/details/41520569 代码下载 : -- GitHub : https://github.com/han1202012/WheelViewDemo.git -- CSDN : http://download.csdn.net/detail/han1202012/8208997 ; 博客总结 : 博文内容 : 本文完整地分析了 WheelView 所有的源码, 包括其适配器类型, 两种回调接…
-------------------author:pkf -----------------------------time:2015-8-20 ---------------------------------------------qq:1327706646 (1) sps 数据结构 (2) 指数哥伦布码(Exponential-Golomb code, 即Exp-Golomb code) (3) 宽高计算 (4) 代码实现 --------------------------------…
Canvas 的width height属性 1.当使用width height属性时,显示正常不会被拉伸:如下 <canvas id="mycanvas" width="300" height="300">浏览器不支持Canvas,请升级或改用其它浏览器!</canvas> <script type="text/javascript"> var canvas = document.getE…