2013-04-26 2 views
0
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" > 
    <gradient 
     android:layout_width="match_parent" 
     android:angle="270" 
     android:centerColor="#4ccbff" 
     android:endColor="#24b2eb" 
     android:startColor="#24b2eb" /> 
<corners android:radius="5dp" /> 
</shape> 

누락 된 행은 "layout_height 속성이없는 요구"NO 4로이드 - 필수 layout_attribute 위 코드와

&

온 "layout_heightlayout_width 속성이없는 불필요"입니다 라인 no .

+0

누락 된 속성을 알려줍니다. 첫 번째 경우에는 layout_height 인 것처럼 보이고 두 번째 경우에는 layout_height와 layout_width가 모두 나타납니다. –

+0

두 번째 경우에는 두 레이아웃 모두에 오류가 표시됩니다. android : layout_height = "wrap_content"코드에 포함 시켰지만 동일한 오류를 보여줍니다. –

+0

높이가 아닌 layout_height입니다. –

답변

1

제 생각에는 모양, 그라디언트 및 모서리에서 레이아웃 정보를 제거하는 것입니다. 파일은 다음과 같아야합니다.

<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
    <gradient 
     android:angle="270" 
     android:centerColor="#4ccbff" 
     android:endColor="#24b2eb" 
     android:startColor="#24b2eb" /> 
    <corners android:radius="5dp" /> 
</shape> 
+0

그게 효과가있어! 감사합니다 :) –

+0

@YuvaRaj 도와 드리겠습니다! –

+0

예, 도형에는 레이아웃이 없습니다. – Ridcully