Why does my android border not display? -
Why does my android border not display? -
border.xml:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#ffffff" /> <stroke android:width="1dip" android:color="#cbcbcb" /> <corners android:radius="7dp" /> </shape>
set background of linearlayout:
<?xml version="1.0" encoding="utf-8"?> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/border" android:orientation="vertical" > //child command </linearlayout>
if linearlayout has kid control: border display ok. if linearlayout have much kid controls, border can't display. why border not display? how set border in case?
because of line :
android:layout_height="wrap_content"
when linearlayout doesn't have kid wrap_content in android:layout_height
cause linearlayout height 0dp , nil gonna show.set size layout , border show up.
android
Comments
Post a Comment