苹果示例程序--视图自适应

示例程序:


UIVisualEffectView 

UIBlurEffect *effect = [UIBlurEffecteffectWithStyle:UIBlurEffectStyleLight];

        _backgroundView = [[UIVisualEffectViewalloc] initWithEffect:effect];

        _backgroundView.contentView.backgroundColor = [UIColorcolorWithWhite:0.7alpha:0.3];

        [selfaddSubview:_backgroundView];


1 // 清空选中cell,是tableviewController的属性,不是tableview的。

self.clearsSelectionOnViewWillAppear =NO;


2 [[NSNotificationCenterdefaultCenter] removeObserver:selfname:UIViewControllerShowDetailTargetDidChangeNotificationobject:nil];

// Sometimes view controllers that are using showViewController:sender and showDetailViewController:sender: will need to know when the split view controller environment above it has changed. This notification will be posted when that happens (for example, when a split view controller is collapsing or expanding). The NSNotification's object will be the view controller that caused the change.

UIKIT_EXTERN NSString *const UIViewControllerShowDetailTargetDidChangeNotificationNS_AVAILABLE_IOS(8_0);

[self showViewController:xiuGai sender:self];[self showDetailViewController:xiuGai sender:self];


static NSString *const AAPLListTableViewControllerCellIdentifier =@"Cell";

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:AAPLListTableViewControllerCellIdentifier];// 自动创建新的cell或者复用cell

// 懒加载数据

- (void)setUser:(AAPLUser *)user

{

    if (_user != user) {

        _user = user;

        if ([self isViewLoaded]) {

            [self.tableView reloadData];

        }

    }

}


4 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

@property ( copy , nonatomic ) NSArray *conversations; // NSArray用copy

+ (instancetype)photoWithDictionary:(NSDictionary *)dictionary

{

    AAPLPhoto *photo = [[selfalloc] init];

    photo.imageName = [dictionaryobjectForKey:@"imageName"];

    photo.comment = [dictionaryobjectForKey:@"comment"];

    photo.rating = [[dictionaryobjectForKey:@"rating"]integerValue];

    return photo;

}

    AAPLProfileViewController *controller = [[AAPLProfileViewControlleralloc] init];

    controller.navigationItem.rightBarButtonItem = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:selfaction:@selector(closeProfile:)];

    UINavigationController *navController = [[UINavigationControlleralloc] initWithRootViewController:controller];

    

    navController.modalPresentationStyle =UIModalPresentationPopover;

    navController.popoverPresentationController.barButtonItem = sender;

    navController.popoverPresentationController.permittedArrowDirections =UIPopoverArrowDirectionAny;

    [selfpresentViewController:navControlleranimated:YEScompletion:NULL];


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值