Binary XML file line #98:Error inflating class Button 解决

布局文件出错

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <Button
                android:id="@+id/orderNowButton"
                android:layout_width="40dp"
                android:layout_height="35dp"
                android:text="Order Now"
                android:background="@drawable/roundbtn_orange"
                android:textColor="#fff"
                />

去掉 background 后,就正常。最后发现,roundbtn_orange.xml 放错了位置

放回到drawable里问题就解决了。。。

参考:https://blog.csdn.net/zhuhai__yizhi/article/details/50827041

猜你喜欢

转载自blog.csdn.net/zhangsansecond/article/details/81127125
今日推荐