WMPageController
WMPageController copied to clipboard
作者您好,请问怎么设置选中的字体加粗?
目前不支持 可以在
- (void)pageController:(WMPageController *)pageController didEnterViewController:(__kindof UIViewController *)viewController withInfo:(NSDictionary *)info;
通过WMMenuView的这个接口获取item设置font
- (WMMenuItem *)itemAtIndex:(NSInteger)index;
您可以加一个selectFontName属性来支持下啊
按照您说的做了一下,感觉效果怪怪的,左右切换,字体展示不自然。
忽然变粗?目前是不支持平滑过渡的
是的,忽然变粗,您有时间增加个属性控制吧,体验不太好
希望作者加个选中字体加粗的功能+1
- (void)setSelected:(BOOL)selected withAnimation:(BOOL)animation { [UIView animateWithDuration:0.2f animations:^{ if (selected) { self.font = [UIFont boldSystemFontOfSize:self.selectedSize]; } else { self.font = [UIFont systemFontOfSize:self.normalSize]; } }]; _selected = selected; if (!animation) { self.rate = selected ? 1.0 : 0.0; return; } _sign = (selected == YES) ? 1 : -1; _gap = (selected == YES) ? (1.0 - self.rate) : (self.rate - 0.0); _step = _gap / self.speedFactor; if (_link) { [_link invalidate]; } CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(rateChange)]; [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; _link = link; }
我在这个方法里面设置bold了,因为selectedSize和normalSize一样大,只是加粗了,切换的时候感觉没那么突然,希望作者后续能加个selectedName之类的属性可以进行设置
希望作者加上这两个属性 titleFontSelected titleFontNormal
希望作者加上这两个属性 titleFontSelected titleFontNormal
+1