gpt4 book ai didi

objective-c - 创建硬自定义按钮

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:47:47 26 4
gpt4 key购买 nike

我不知道如何构造这个按钮。我在创建这个时需要帮助,请注意当按钮处于事件状态时不会绘制 strip 。我应该使用哪些元素?

在链接上你可以看到这个按钮

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)];

有什么想法吗?

最佳答案

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

关于objective-c - 创建硬自定义按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13048965/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com