共有16篇文章,第1页,共1

  • iOS开发:给定一个位置label的显示问题[提问]
    费费 发表于 2014-06-17 10:40|4次评论|4183次阅读
    给定一个较大的位置,用来放一个label,但是label长度不一定。长的时候,多行,没有问题。但是短的时候,就有问题了。能不能让它在上面,不是在中间?
  • UIView中添加的UILabel为什么显示不出来呢[提问]
    anyine 发表于 2013-11-16 23:54|3次评论|3046次阅读
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];  // Override point for customization after application launch.  self.window.backgroundColor = [UIColor whiteColor];  view = [[UIView alloc]initWithFrame:[[U...
  • UILabel 添加背景图片[博客]
    Youtubeornotobe 发表于 2013-09-25 12:07|2次评论|944次阅读
    做UI的时候我们可能想给某个Label添加一个背景图片,但查看的时候会发现好像只有设置背景颜色的方法,不过我们也可以通过这种方式来解决: UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgtopic.png"]]; [myLabel setBackgroundColor:color];...
  • UILabel 自动高度计算[博客]
    常思过 发表于 2013-08-11 23:21|0次评论|2028次阅读
    #pragma mark UILabel 自动高度计算 - (void) labelAutoHeight:(UILabel *) contentLabel:(NSString *) text { UIFont *font = [UIFont systemFontOfSize:12]; contentLabel.font = font; [contentLabel setNumberOfLines:0]; contentLabel.l...
  • iOS学习5:UILabel的使用[博客]
    芳仔小脚印 发表于 2013-07-17 16:41|3次评论|26518次阅读
    一、初始化 UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, 120, 44)]; [self.view addSubview:myLabel]; 二、设置文字  ①、设置默认文本 NSString *text = @"标签文本"; myLabel.text = text; 效果: ②、设置标签文本(此属性是iOS6....
  • iOS在UILabel显示渐变字体[博客]
    广州英趣科技 发表于 2013-06-06 17:58|0次评论|4634次阅读
      项目开发中需要使用渐变字体标题,在UILabel显示渐变字体: //set the title UIColor *titleColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"iCtrl_Title_Bg"]]; NSString *title = NSLocalizedString(@"Setting", nil); UILabel *...
  • UILabel根据字数多少自动实现适应高度[博客]
    meilidashijie 发表于 2013-01-06 18:44|0次评论|2953次阅读
      UILabel *msgLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 45, 0, 0)]; //290 230 msgLabel.backgroundColor = [UIColor lightTextColor]; [msgLabel setNumberOfLines:0]; msgLabel.lineBreakMode = UILineBreakModeWordWrap; UIFont *fonts = [UIF...
  • UILabel 上显示*号 都会比较靠上,有没有大神告诉我,怎么样让*号在UILabel上居中显示呢[提问]
    颜妍 发表于 2012-12-03 21:37|1次评论|827次阅读
    UILabel 上显示*号 都会比较靠上,有没有大神告诉我,怎么样让*号在UILabel上居中显示呢,这个问题困扰我好久了,求大神支招!!!!
  • UILable UILabel的各种属性与方法的使用[博客]
    ZZPlus 发表于 2012-11-22 14:10|1次评论|1404次阅读
    - (void)viewDidLoad { UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 20.0, 200.0, 50.0)]; UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 80.0, 200.0, 50.0)]; UILabel *label3 = [[UILabe...
  • UILabel的各种属性与方法的使用 [博客]
    ZZPlus 发表于 2012-11-22 13:24|0次评论|416次阅读
    #import "LabelTestViewController.h" @implementation LabelTestViewController /* Accessing the Text Attributes text property font property textColor property textAlignment property lineBreakMode property ...
  • ios开发 显示指定的视图的边框粗细与颜色[提问]
    heiansan 发表于 2012-09-11 17:27|0次评论|1472次阅读
    大侠们: 这里有一个label视图,可以通过layer设置该视图边框4个边的颜色和粗细。 问:可以设置指定的边的颜色和粗细吗?比如:只想设置label视图的上、下、左3个边框的颜色和粗细。
  • ios 动态修改UILabel字体大小[博客]
    JasonZhao 发表于 2012-08-06 21:25|1次评论|10811次阅读
    - (IBAction)sliderChange:(id)sender {   NSLog(@"sliderChange");   UISlider *slider = (UISlider *) sender;   NSString *labelContent = dynamic_label.text;    /**********中间部分比较重要*********************/   CGSize size = [labelContent size...
  • Iphone开发UILable和UITextField[分享]
    晨曦之光 发表于 2012-05-16 17:04|0次评论|1717次阅读
    1)初始化UILabel 1 2 3 4 5 6 7 8 9 10 11 12 13 UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake((self.bounds.size.width / 2), 0.0, 150.0, 43.0) ];   scoreLabel.textAlignment =  UITextAlignmentCenter;   scoreLabel.text = @ "我是Andy-...
  • IOS开发学习笔记(1)-----UILabel 详解[代码]
    ClownFish 发表于 2012-05-10 12:46|0次评论|8807次阅读
    最近在学习ios开发,觉得有必要做个备忘,以下内容是我找个api注释的,希望对大家有点帮助,我自己也做个备忘
  • [转]设置 UILabel 和 UITextField 的 Padding 或 Insets[博客]
    MrMign 发表于 2012-03-29 17:42|0次评论|1151次阅读
    iOS 的控件,只看到 UIButton 可以设置 Padding/Insets,即按钮上文字或图片与按钮边界的间隙,对与 CSS 来说叫做 Padding,在 iOS 中叫做 Insets,UIButton 设置 Insets 相应的属性如下: Configuring Edge Insets       contentEdgeInsets  property  ...
  • 设置 UILabel 的背景为透明[分享]
    鉴客 发表于 2012-01-09 10:42|1次评论|3666次阅读
    UILabel缺省的背景是不透明的,创建后其背景颜色会覆盖背后的视图内容,而在开发时,一般是需要UILabel背景透明,仅显示文字即可,背景则显示所在视图的内容。 设置UILabel的背景为透明只需要将其属性backgroundColor设置为UIColor的clearColor即可,代码语法如下: label....
top Created with Sketch. 顶部