2

我不知道如何构建这个按钮。我需要帮助来创建它,请注意,当按钮处于活动状态时,条带不会被绘制。我应该使用哪些元素?

在链接上,您可以查看此按钮

http://i.stack.imgur.com/0mmJ0.png

    UIButton *clone = [[UIButton alloc] initWithFrame:frame];
    [clone setTitle:strDate forState:UIControlStateNormal];
    [clone setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
    clone.frame = CGRectMake(19, post_offer_top*(i-1)+22, 281, 75);
    clone.tag = my_id;
   // [clone setTitle:[[buttons objectAtIndex:i-1] objectForKey:@"title"] forState:UIControlStateNormal];
    clone.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    clone.contentEdgeInsets = UIEdgeInsetsMake(44, 31, 0, 0);
    [clone setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [clone setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [clone.titleLabel setFont:[UIFont fontWithName:@"PF DinDisplay Pro" size:10]];
    [clone.titleLabel setShadowOffset:CGSizeMake(0.0f, 1.0f)];

有任何想法吗?

4

1 回答 1

1

您应该像这样初始化按钮 [UIButton buttonWithType:UIButtonTypeCustom]

于 2012-10-24T12:15:01.043 回答