我面临在不同的推送视图中有长标题的问题。我想动态调整它的大小,并且我根本没有任何问题,但是对于很长的标题,这可能会很难看,所以我想到了在动画中显示文本的文本横幅。UINavigationController titleView动画
有没有办法使用的UIView动画与titleview的移动为整个文本(屏蔽)的方法吗?
干杯
我面临在不同的推送视图中有长标题的问题。我想动态调整它的大小,并且我根本没有任何问题,但是对于很长的标题,这可能会很难看,所以我想到了在动画中显示文本的文本横幅。UINavigationController titleView动画
有没有办法使用的UIView动画与titleview的移动为整个文本(屏蔽)的方法吗?
干杯
尝试这种自定义控件第一..
方法2
UIView *myView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 300, 30)];
UILabel *title = [[UILabel alloc] initWithFrame: CGRectMake(40, 0, 300, 30)];
title.text = NSLocalizedString(@"My Title", nil);
[title setTextColor:[UIColor whiteColor]];
[title setFont:[UIFont boldSystemFontOfSize:20.0]];
[title setBackgroundColor:[UIColor clearColor]];
UIImage *image = [UIImage imageNamed:@"MyLogo.png"];
UIImageView *myImageView = [[UIImageView alloc] initWithImage:image];
myImageView.frame = CGRectMake(0, 0, 30, 30);
myImageView.layer.cornerRadius = 5.0;
myImageView.layer.masksToBounds = YES;
myImageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
myImageView.layer.borderWidth = 0.1;
[myView addSubview:title];
[myView setBackgroundColor:[UIColor clearColor]];
[myView addSubview:myImageView];
self.navigationItem.titleView = myView;
这对您有帮助吗? – user1673099
有很多免费的开源控件用于此目的,但是这是我用它的方便的一个控制 TickerView
这是否意味着您想要将标题移动为选取框?对? –
http://stackoverflow.com/questions/10911252/how-to-move-text-on-navigation-bar – iPatel