我正在开发一个自定义UICollectionViewLayout
按日/周/月组织的单元格.
它不是滚动平滑,看起来滞后是由[UICollectionView _updateVisibleCellsNow]
每个渲染循环调用引起的.
性能对于<30项是可以的,但在大约100或更高时,它非常慢.这是UICollectionView和自定义布局的限制,还是我没有给视图足够的信息来正确执行?
来源:https://github.com/oskarhagberg/calendarcollection
布局:https://github.com/oskarhagberg/calendarcollection/blob/master/CalendarHeatMap/OHCalendarWeekLayout.m
数据源和代理:https://github.com/oskarhagberg/calendarcollection/blob/master/CalendarHeatMap/OHCalendarView.m
时间档案:
更新
也许它徒劳无功?一些测试与普通UICollectionViewController
带UICollectionViewFlowLayout
被给予大约的细胞/屏幕结果相同的量以类似的时间曲线.
我觉得它应该能够在没有抖动的情况下一次处理~100个简单的不透明单元.我错了吗?
我有一个使用Jersey构建的REST服务.
我希望能够根据发送到服务器的MIME设置我的自定义异常编写器的MIME.application/json
收到json application/xml
时,以及收到xml 时返回.
现在我硬编码application/json
,但这使得XML客户端陷入了困境.
public class MyCustomException extends WebApplicationException {
public MyCustomException(Status status, String message, String reason, int errorCode) {
super(Response.status(status).
entity(new ErrorResponseConverter(message, reason, errorCode)).
type("application/json").build());
}
}
Run Code Online (Sandbox Code Playgroud)
我可以利用什么上下文来获取当前请求Content-Type
?
谢谢!
对于任何对完整解决方案感兴趣的人:
public class MyCustomException extends RuntimeException {
private String reason;
private Status status;
private int errorCode;
public MyCustomException(String message, String reason, Status status, int errorCode) {
super(message);
this.reason = reason;
this.status = status;
this.errorCode = errorCode;
}
//Getters and setters
} …
Run Code Online (Sandbox Code Playgroud)