Ios Xcode:UITableViewCell自定义,如Facebook
我正在进行UITableViewCell定制,我尝试了很多东西。我用过子视图,我用过drawrect,我两个都用过,但每次我都不能平滑滚动。让我再补充一点:即使Facebook新闻提要的滚动也不那么平滑,但我看到一些应用程序(如GetGlue)有自定义单元格(一些带有文本,一些带有图像),滚动非常平滑 我只是问是否有一种方法可以帮助我得到最好的结果 注意:图像是使用SDWEBIMAGE下载的 以下是一些代码(这是uitableviewcell子视图的drawrect方法): PS:对不起,我的英语不好 截图: ----意大利语----- 大家好,我很高兴创建联合国社交网络che si chiamastartMe。 “molto molto”的比喻是“al-tuo”。 不同的是,这是一个共同的问题,是解决非利益的问题 在细胞分离的过程中,需要使用不同的文件格式,以确保其内容的完整性。在分词中,指的是一个单独的词,它指的是一个适当的高度强制或相似性的词;) 我的职业生涯是在英托皮的世仇中,在youtube上有一段视频 )() -----英式----- 您好,我刚刚创建了一个名为startMe的社交网络。 它在图形和组织方面与您的非常相似。 不同的是,您正在绘制单元代码,这绝对不好 您必须使用已绘制的单元格创建文件,然后只需管理内容和高度。特别是高度,在委托表heightForCellAtIndexPath或类似的方法中只需计算一次;) 我的项目正在出售,我必须说它运行顺利,你也可以在youtube上观看视频 )() ----意大利人---- 这是一个关于核心图形和图图的描述。 这是一种新的生活方式,它可以使人的精神受到损害。每辆车的收费标准如下: ----英式---- 我还看到很多东西都是用图形核心设计的,这会减慢整个过程。 这是非常容易的,如果你对层图像的属性采取行动。下面是我班上的一个地方,我曾经像你一样把图像弄圆: h ----意大利人---- 在图像视图的基础上,创建一个全新的图像视图界面生成器。在这一点上,我认为这是一个非常重要的问题,我认为这是一个非常重要的问题。O对利益相关者的默认效用进行修正 斯佩罗·迪·埃塞蒂·斯塔托·乌蒂莱;) ----英式---- 这只是扩展UIImageView类,您只需在imageView接口生成器上的对象上设置它。从那时起,处理表格单元格的方法中的代码就可以调用类的方法来设置边框和颜色(如果需要)。或者,您也可以将modificarti类默认为使用您感兴趣的功能Ios Xcode:UITableViewCell自定义,如Facebook,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我正在进行UITableViewCell定制,我尝试了很多东西。我用过子视图,我用过drawrect,我两个都用过,但每次我都不能平滑滚动。让我再补充一点:即使Facebook新闻提要的滚动也不那么平滑,但我看到一些应用程序(如GetGlue)有自定义单元格(一些带有文本,一些带有图像),滚动非常平滑 我只是问是否有一种方法可以帮助我得到最好的结果 注意:图像是使用SDWEBIMAGE下载的 以下是一些代码(这是uitableviewcell子视图的drawrect方法): PS:对不起,我的英
希望这有用;) 发布你想要实现的目标的截图。Auw。去奥克恰塔。在公用事业方面,我没有考虑到任何问题。格雷齐·马特奥!达维罗·莫尔托(davvero molto)是克里迪米(credimi)的重要人物,他写了一篇短文,写了一篇短文,写了一篇短文,写了一篇短文,写了一篇短文,写了一篇短文。在法律法规和法律法规中出现的上诉;)我的做法是在我的房间里用同样的方法划船。你可以在你的房间里找到一个完整的房间。格雷兹·马特奥,你可以在你的房间里找到一个完整的房间。我的目标是为所有项目提供服务,并为其提供服务。Grazie ancora,提供了一份完整的文件和视频。这是一份完整的文件,它是一份完整的文件这是我的最爱,我的最爱。我不知道该怎么做,因为它是一种不动产,它是一种不动产。在realtála cosa migliore sarebbe中,我在automatico中使用了一种新的方法。粒子的位置(如图所示)
- (void)drawRect:(CGRect)rect
{
// Ottengo il contenuto grafico
CGContextRef context = UIGraphicsGetCurrentContext();// Background
CGContextSaveGState(context);
CGPathRef path = CGPathCreateWithRect(CGRectMake(10, 10, 300, self.frame.size.height - 15), NULL);
[[UIColor whiteColor] setFill];
CGContextAddPath(context, path);
CGContextSetShadowWithColor(context, CGSizeMake(0, 0), 3.5, [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2].CGColor);
CGContextSetBlendMode (context, kCGBlendModeNormal);
CGContextDrawPath(context, kCGPathFill);
CGPathRelease(path);
CGContextRestoreGState(context);
// Rettangolo per Social Button
UIImage *socialRectImage = [UIImage imageNamed:@"activitySocialBarBackground"];
CGRect socialRect = CGRectMake(10, self.frame.size.height - 35 - 5, 300, 35);
CGPathRef socialBarPath = CGPathCreateWithRect(socialRect, NULL);
CGContextAddPath(context, socialBarPath);
[socialRectImage drawInRect:socialRect];
CGPathRelease(socialBarPath);
//###### Immagine
// Actor Image
CGRect imageRect = CGRectMake(18, 18, 40, 40);
CGContextSaveGState(context);
CGPathRef clippath = [UIBezierPath bezierPathWithRoundedRect:imageRect cornerRadius:20].CGPath;
CGContextAddPath(context, clippath);
CGContextClip(context);
[[activityArray objectForKey:@"actorImage"] drawInRect:imageRect];
CGContextRestoreGState(context);
// Actor DisplayName
CGPoint point;
NSDictionary *mainTextAttributes = @{ NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:13.5f], NSForegroundColorAttributeName : [UIColor colorWithRed:130.0f/255.0f green:27.0f/255.0f blue:67.0f/255.0f alpha:1] };
NSAttributedString *localeNameAttributedString = [[NSAttributedString alloc] initWithString:activity.actor.displayName attributes:mainTextAttributes];
point = CGPointMake(66, 23);
[localeNameAttributedString drawAtPoint:point];
// Activity Time Type
NSDictionary *TimeTypeTextAttributes = @{ NSFontAttributeName : [UIFont systemFontOfSize:12.0f], NSForegroundColorAttributeName : [UIColor grayColor] };
NSAttributedString *TimeTypeAttributedString = [[NSAttributedString alloc] initWithString:[activityArray objectForKey:@"activityTimeType"] attributes:TimeTypeTextAttributes];
point = CGPointMake(66, 40);
[TimeTypeAttributedString drawAtPoint:point];
// Activity Message
CGSize ActivityMessageTextSize = [activity.shortMessage sizeWithFont:[UIFont fontWithName:@"HelveticaNeue" size:14.0f] constrainedToSize:CGSizeMake(280, 100) lineBreakMode:NSLineBreakByWordWrapping];
CGRect newTextFrame = CGRectInset(CGRectMake(18, 68, 280, 100), 0, 0);
[activity.shortMessage drawInRect:newTextFrame withFont:[UIFont fontWithName:@"HelveticaNeue" size:14.0f] lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
// Object Image
if ( [imagesDownload objectForKey:@"objectImage"] != nil ) {
CGRect objectImageRect = ( activity.object.image.url != nil ) ? CGRectMake(0, 68 + ActivityMessageTextSize.height, 300, 168) : CGRectMake(-5, 68 + ActivityMessageTextSize.height, 310, 310);
CGContextSaveGState(context);
clippath = [UIBezierPath bezierPathWithRoundedRect:objectImageRect cornerRadius:0].CGPath;
CGContextAddPath(context, clippath);
CGContextClip(context);
//[[imagesDownload objectForKey:@"objectImage"] drawInRect:objectImageRect];
CGContextRestoreGState(context);
}
}
//
// RoundCornerImage.h
// startMe
//
// Created by Matteo Gobbi on 24/08/13.
// Copyright (c) 2013 Matteo Gobbi. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RoundCornerImageView : UIImageView
-(void)setBorderWidth:(float)width;
-(void)setCornerRadius:(float)radius;
-(void)setBorderColor:(UIColor *)color;
-(void)setCircleMask;
@end
//
// RoundCornerImage.m
// startMe
//
// Created by Matteo Gobbi on 24/08/13.
// Copyright (c) 2013 Matteo Gobbi. All rights reserved.
//
#import "RoundCornerImageView.h"
@implementation RoundCornerImageView
-(void)awakeFromNib {
[super awakeFromNib];
CALayer * l = [self layer];
[l setMasksToBounds:YES];
[l setCornerRadius:10.0];
// You can even add a border
[l setBorderWidth:self.frame.size.width/IMG_PROFILE_BORDER_SCALE];
[l setBorderColor:[[UIColor grayColor] CGColor]];
}
-(void)setBorderWidth:(float)width {
[[self layer] setBorderWidth:width];
}
-(void)setCornerRadius:(float)radius {
[[self layer] setCornerRadius:radius];
}
-(void)setBorderColor:(UIColor *)color {
[[self layer] setBorderColor:[color CGColor]];
}
-(void)setCircleMask {
[[self layer] setCornerRadius:self.frame.size.width/2.0];
}
@end