阅读背景:

使用Robolectric测试自定义视图:宽度和高度始终为0

来源:互联网 

I have build a custom View (DrawView) for a drawing app. It depends heavily on a real width and height for internal bitmaps. When I try to test it with Robolectric 2.2, the view has a length and width of 0 which crashes my internal logic. How can I mock a real screen size? I use a simple LinearLayout with the DrawView as the only element in it to test. Here is my layout:I have build a custom View (DrawView) for a dra




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: