UIButton 按钮操作/*
一 UIVIew 常见属性
1.frame 位置和尺寸(以父控件的左上角为原点(0,0))
2.center 中点 (以父控件的左上角为原点(0,0))
3.bounds 位置和尺寸(以自己的左上角为原点 (0,0))
4.transform 形变属性(缩放,旋转)
5.backgroundColor 背景颜色
6.tag 标识(父控件可以根据这个标识找...
分类:
其他好文 时间:
2015-04-24 10:39:02
阅读次数:
167
UIView类函数原型@interface UIView(UIViewAnimationWithBlocks)+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void...
分类:
其他好文 时间:
2015-04-23 15:39:04
阅读次数:
269
这是在iOS7上,tableview 的sectionHeaderView中报错
*** Assertion failure in -[****.****UITVSectionHeader_Team layoutSublayersOfLayer:], /SourceCache/UIKit/UIKit-2935.137/UIView.m:8794
libc++abi.dylib: termina...
分类:
其他好文 时间:
2015-04-22 11:45:03
阅读次数:
226
NSString *str = @"0123456789”;//label内容
NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc] initWithString:str];
//根据下标索引设置字体颜色
[str addAttribute:NSForegroundColorAttributeName value:...
分类:
移动开发 时间:
2015-04-21 16:06:16
阅读次数:
165
#import<UIKit/UIKit.h>@interfaceLTView:UIView#warning创建需要的属性@property(nonatomic,retain)UILabel*mLabel;@property(nonatomic,retain)UITextField*mTextField;@end#import"LTView.h"@implementationLTView#warning第一步,重写初始化方法-(instancetype)initW..
分类:
其他好文 时间:
2015-04-21 11:28:04
阅读次数:
135
UICollectionView的创建基本与UITableView的创建方式相同
首先,创建继承于UICollectionView的子类
然后在初始化方法中设置一些属性
- (id)initWithFrame:(CGRect)frame
{
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout al...
分类:
移动开发 时间:
2015-04-20 18:37:23
阅读次数:
135
具体问题一:
布局正确,但是cell上的UI控件都跑到了屏幕外面,如图所示:
cell上有两个控件,问题demo如下,主要出在第一个self.centerX上,去掉这个代码,重新写一个居中的方法
_headImgView.centerX
= self.centerX;
_nameLabel.centerX =
_headImgView.centerX;...
分类:
移动开发 时间:
2015-04-20 18:33:16
阅读次数:
202
//
// ViewController.swift
// UITextField键盘类型
//
// Created by mac on 15/4/19.
// Copyright (c) 2015年 mac. All rights reserved.
//
import UIKit
class ViewController: UIViewCont...
分类:
编程语言 时间:
2015-04-20 09:33:49
阅读次数:
684
新建一个Button并绑定点击事件 1 // 创建Button对象,初始化位置大小(位置坐标为左上角点和右下角点) 2 UIButton *btn = [[UIButton alloc] initWithFrame: CGRectMake(100, 100, 120, 110)]; 3 4 // ....
分类:
移动开发 时间:
2015-04-20 00:11:48
阅读次数:
128
UIKit
Note
注意
When linking against iOS 8.3, any code that relies on layout information (such as the frame) of a UIButton subview
when the button is not in the window hierarchy will need to...
分类:
移动开发 时间:
2015-04-16 14:21:27
阅读次数:
164