Android布局低级错误

RelativeLayout属性错误导致报错

跟着书也能写错代码,记录一下我这个蠢蛋的低级错误
android:layout_alignTop=“true”
android:layout_alignLeft=“true”
android:layout_alignLeft=“true”
报错
Error:(17, 34) Boolean types not allowed (at ‘layout_alignTop’ with value ‘true’).
Error:(18, 35) Boolean types not allowed (at ‘layout_alignLeft’ with value ‘true’).
Error:(26, 35) Boolean types not allowed (at ‘layout_alignLeft’ with value ‘true’).
顺便总结一下属性值为true或false:
android:layout_centerHrizontal
android:layout_centerVertical
android:layout_centerInparent
android:layout_alignParentBottom
android:layout_alignParentLeft
android:layout_alignParentRight
android:layout_alignParentTop
android:layout_alignWithParentIfMissing

你可能感兴趣的:(Android布局低级错误)