UIVisualEffectView *visualEffect = [[UIVisualEffectView alloc]initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];
visualEffect.frame = CGRectMake(20, 90, 280, 300);
visualEffect.alpha = 0.9;
let topBorder= CALayer ()
topBorder. frame = CGRectMake ( 0 , 0 , myImageView. frame . width , 1 )
topBorder. backgroundColor = UIColor . blackColor (). CGColor
myImageView. layer . addSublayer (topBorder)
let leftBorder= CALayer ()
leftBorder. frame = CGRectMake ( 0 , 0 , 1 , myImageView. frame . height )
leftBorder. backgroundColor = UIColor . blackColor (). CGColor
myImageView. layer . addSublayer (leftBorder)
let bottomBorder= CALayer ()
bottomBorder. frame = CGRectMake ( 0 , myImageView. frame . height , myImageView. frame . width , 1 )
bottomBorder. backgroundColor = UIColor . blackColor (). CGColor
CALayer *bottomBorder=[[ CALayer alloc ] init ];
bottomBorder. frame = CGRectMake ( 0 , 0 , hView. frame . size . width , 0.5 );
bottomBorder. backgroundColor = lineGrayColor . CGColor ;
[orderStateAttributedString addAttribute : NSForegroundColorAttributeName value :[ UIColor blackColor ] range : NSMakeRange ( 0 , 5 )];
[orderStateAttributedString addAttribute : NSFontAttributeName value :[ UIFont systemFontOfSize : 14 ] range : NSMakeRange ( 0 , 5 )];
[ self . contentView layoutIfNeeded ];
[ self . contentView removeConstraint : self . photographButtonConstraint ];
self . photographButtonConstraint = [ NSLayoutConstraint
constraintWithItem : self . photographButton
attribute : NSLayoutAttributeLeft
relatedBy : NSLayoutRelationEqual
toItem : self . photographImageViewArray [imageArray. count ]
attribute : NSLayoutAttributeLeft
multiplier : 1
constant : 0 ];
CAShapeLayer *maskLayer = [[ CAShapeLayer alloc ] init ];
maskLayer. frame = self . submitAlertView . bounds ;
maskLayer. path = maskPath. CGPath ;
mytest:
)
- (
void
) mytest:(NSNotification*) notification
{
id obj = [notification object];
//获取到传递的对象
}
postNotificationName : @"reloadMessageData"
传递的对象
"
];
[navigationArray removeObjectAtIndex : navigationArray. count - 1 ]; // You can pass your index here
{
CGRect tempFrame = self . infoView . frame ;
tempFrame. origin . y += 40 ;
self . infoView . frame = tempFrame;
CGRect scrollFrame = self . myScrollView . frame ;
scrollFrame. origin . y += 40 ;
self . myScrollView . frame = scrollFrame;
} completion :^( BOOL finished){
NSArray *gardenOptionsArray = self . gardenOptionsView . subviews ;
for ( int i = 0 ;i<gardenOptionsArray. count ;i++){
UIView *clearView = ( UIView *)gardenOptionsArray[i];
[clearView removeFromSuperview ];
UIView的显示位置:
将一个UIView显示在最前面只需要调用其父视图的 bringSubviewToFront()方法。
将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。
[self.view insertSubview:girlView belowSubview:bottomView];//把girlView插入到bottomView后面
[self.view insertSubview:girlView aboveSubview:bottomView];//把girlView插入到bottomView前面
alpha 属性为0.0时视图完全透明,为1.0时视图完全不透明。
hidden属性为YES时视图隐藏,否则不隐藏。
这两种方式的效果是相同的。
视图的alpha值会影响子视图的绘制,但是子视图的alpha值不变。子视图真正渲染出来的alpha值等于子视图的alpha乘父视图的alpha。
AppStore检查更新的json地址http://itunes.apple.com/lookup?id=%@&country=cn
- // 如果要实现在应用里面跳到appstore的对应评论页面里面的话,只要将下面地址中App_ID替换成自己的id就可以了,其他的地方都不用管。
- // 如果要用Safari浏览器做实验的话可以将地址中的 "itms-apps://" 替换成"http://"即可。
- // 另外也可以尝试地改变其中几个参数的数值,可以看看结果。
- // 注意: 必须使用真机调试,目前来说还是不支持模拟器运行的
- NSString * appstoreUrlString = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?mt=8&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software&id=APP_ID";
- NSURL * url = [NSURL URLWithString:appstoreUrlString];
- if ([[UIApplication sharedApplication] canOpenURL:url])
- {
- [[UIApplication sharedApplication] openURL:url];
- }
- else
- {
- NSLog(@"can not open");
- }