jsfu / JSDropDownMenu

类似美团的下拉菜单
MIT License
565 stars 138 forks source link

发现分类标签以及分类的内容字体都有模糊感. #10

Open LoSenTrad opened 7 years ago

LoSenTrad commented 7 years ago

你好! 不知道你们发现没有呀,如题所述问题.模糊感,感觉怪怪的.是不是字体被压缩还是放大了?求支援...

jsfu commented 7 years ago

发一下截图吧

xiaobing1024 commented 7 years ago
  1. 标题像素未对齐,导致有点模糊,原因:坐标和大小不是整数。解决:使用ceilf()方法。 例子:改变CATextLayer *layer的大小位置时,都处理一下
    layer.bounds = CGRectMake(0, 0, ceilf(size.width), ceilf(size.height));
    layer.position = CGPointMake(ceilf(point.x), ceilf(point.y));
  2. tableView的label像素未对齐,导致模糊,原因:
    -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 0.1;
    }

    改成 return CGFLOAT_MIN; footer同理。 或者第二种解决方法:UITableViewStyleGrouped 改成 UITableViewStylePlain,删除heightForHeaderInSectionheightForFooterInSection方法

xiaobing1024 commented 7 years ago

具体用模拟器的 Debug->Color Misaligned Images 查看 红色就是没有对齐