Android类“this”组件

时间:2016-02-09 09:17:51

标签: android class variables field

当我在课程方法中记录“ this ”时

Log.i(TAG, "this:"+this);

结果是:

this:android.myapp.MyView{43354c80 V.ED.... ........ 0,9-104,61 #7f0b0005 app:id/myViewID}

带字段

43354c80 - ?
V.ED .... ........ - ?一些位域,V可能是可见性
0,9-104,61 - 剪辑矩形 #7f0b0005 - ?
app:id / myViewID - R.id。*

什么意思“?”日志中的“this”字段?

===编辑===

由于所有评论都不可见,我从@Blackbelt回答& amp;评价。

在这种情况下:

43354c80 - hashCode()的结果
V - 可见
E - 启用
D - 取决于setWillNotDraw()
0,9-104,61 - 绘制矩形 7f0b0005 - getId()的结果 app:id / myViewID - id as a string

1 个答案:

答案 0 :(得分:3)

正如您可以映像一样,您在日志中阅读的内容是render()Object#toString()的覆盖版本:

View停留在V

View.VISIBLE停留在E

ENABLED

它是View的ID toHex。您可以阅读完整的方法patch Directories