Custom view in Eclipse preview times wrong
650) this.width=650; "title=" capture. PNG "alt=" wkiol1v6znbw0inkaaogpiqcka4982.jpg "src=" http://s3.51cto.com/wyfs02/M00/6E/5C/ Wkiol1v6znbw0inkaaogpiqcka4982.jpg "/>
According to the ECLISPE hint Tip:use view.isineditmode () in the your custom views to skip code when shown in Eclipse, navigate to the error code that will cause this error code Row with
if (!isineditmode ()) {//code snippet causing error}
Wrap it up so that it will skip this code snippet when it is displayed in Eclipse and no longer error, as modified below
650) this.width=650; "title=" capture. PNG "alt=" wkiol1v6z-dzjgieaahx6us2vfs670.jpg "src=" http://s3.51cto.com/wyfs02/M02/6E/5C/ Wkiol1v6z-dzjgieaahx6us2vfs670.jpg "/>
If the variable in your code is defined as the final type after the change, the blank final field Lasercolor May is not having been initialized error, Because the final type must be initialized at construction time, that is, either set in the constructor or after the variable definition. Because an IF condition statement is added to the constructor, the final variable initialization statement is not necessarily executed, so we remove the final keyword from the following variable, and the problem is solved.
650) this.width=650; "title=" capture. PNG "alt=" wkiol1v6adibloifaadopboah0k999.jpg "src=" http://s3.51cto.com/wyfs02/M02/6E/5C/ Wkiol1v6adibloifaadopboah0k999.jpg "/>
This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1661196
Android Custom view cannot be previewed