RJContactDetailsView 0.0.2

RJContactDetailsView 0.0.2

测试测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2014年12月

rayjune维护。



  • rayjune

RJContactDetailsView 是一个用于显示联系信息的美丽视图,包括头像、姓名和电话号码。

屏幕截图

Resize icon

安装

手动安装

下载项目的 zip 文件,并将类 RJContactDetailsView.hRJContactDetailsView.m 放到您的项目中。示例中有简单的模型:RJContact.hRJContact.m。这是一个用于显示视图的模型。

如何使用

#import "RJContactDetailsView.h"

RJContactDetailsView *contactDetailsView = [[RJContactDetailsView alloc] initWithHeadImage:[UIImage imageNamed:@"head"] contactName:@"rayjune" phones:@[@"15088888888",@"15067755555"]];
{
    //set appearance
    contactDetailsView.topBarColor = [UIColor blueColor];
    contactDetailsView.intoDetailsButtonNormalTextColor = [UIColor blackColor];
    contactDetailsView.intoDetailsButtonHightlightedTextColor = [UIColor lightTextColor];
    contactDetailsView.contactNameLabelTextColor = [UIColor blackColor];
    contactDetailsView.intoDetailsButtonTitle = @"More details";

    contactDetailsView.headImage = [UIImage imageNamed:@"head"];
    contactDetailsView.contactName = @"rayjune";
}
contactDetailsView.dataSource = self;
contactDetailsView.delegate = self;
[contactDetailsView show];

委托和数据源

#pragma mark - RJContactDetailsView DataSource
- (UITableViewCell *)contactTableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath phones:(NSArray *)phones
{
    static NSString *cellID = @"CellID";
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    cell.textLabel.textColor = [UIColor blackColor];
    cell.textLabel.font = [UIFont boldSystemFontOfSize:18];
    cell.textLabel.text = phones[indexPath.row];
    return cell;
}

#pragma mark - RJContactDetailsView Delegate
- (void)contactTableViewDidSelectPhone:(NSString *)phone
{
    NSLog(@"You touched %@!",phone);
}
- (void)contactDetailsViewDidTouchedIntoDetails:(RJContactDetailsView *)contactDetailsView
{
    NSLog(@"You touched into more details button!");
}

许可

实际上,您可以以任何方式使用这些代码。如果您将其分叉或星标,我将非常高兴。