开发者

View within View (Android)

开发者 https://www.devze.com 2023-03-23 23:31 出处:网络
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. E

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

精彩评论

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