如果,而且在Activity里通过 findViewById(R.id.xxx)获取不到控件xml:
<com.tailfun.entity.Key
android:id="@+id/powerKey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="30px"
android:layout_y="30px"
android:visibility="gone" />
activity:Key powerKey=(Key) (findViewById(R.id.powerKey));这里powerKey就是null,我没有写属性配置文件attr.xml,会是这个问题么?
<com.tailfun.entity.Key
android:id="@+id/powerKey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="30px"
android:layout_y="30px"
android:visibility="gone" />
activity:Key powerKey=(Key) (findViewById(R.id.powerKey));这里powerKey就是null,我没有写属性配置文件attr.xml,会是这个问题么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货