开发者

View within View (Android)

So I can pass a custom View to the setContentView() and it fills the users screen by default(right?), but if I define a TextField within my custom views constructor it won开发者_运维技巧't display. Even if I change my custom View to a custom ViewGroup and use its addView() method.

So what am I missing here?

Also, whats the equivalent of System.out.println() in android to get some feedback?


for print statements, used Log.d("Name of the filter", "Text to be printed here"). Also, why aren't you defining your view in an XML file and adding the textview inside there? it is usually not a good idea to use addview because it makes laying things out more difficult (not as many options for location and size, etc.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜