开发者

Android .designer.cs equivalent?

I've just coded android for a few months, and I really enjoy it, but I find myself writing the same "(TextV开发者_开发知识库iew)findViewById(R.id.mytextview)" code over and over again.

Coming from asp.net I can't help but wonder why there's no auto-generated class from which I can access my xml-declared views(controls) strongly typed?

Actually I kind of solved it for myself by creating a "viewshelper"-class for complex activities, so I can do "_views.mytextview" when I need the textview, but I still have to maintain these classes by hand each time I add or remove views.

Am I missing something, or should the android sdk do this for me?


Take a look onto roboguice, it looks like the library takes care about the problem.


IMHO, You are missing the Java approach for application development.

This is quite normal for those that use Eclipse (with out plugins) at the beginning this seam to be very problematic, but now i think that that show only the developer limitation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜