내 응용 프로그램의 "카드"안에 레이블로 작은 직사각형 모양을 추가하려고하는데 XML을 통해이를 수행하는 방법을 알고 싶습니다.카드보기에 도형을 가져올 수 없습니다.
여기 내 진행 지금까지의 :
내보기로 드로어 블 자원으로
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line" > <solid android:color="#32b4e4" /> <size android:width="20dp" android:height="2dp" /> </shape>
가져 오기를 모양을 만든
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="6dp" android:layout_marginRight="6dp" android:layout_marginTop="4dp" android:layout_marginBottom="4dp" android:background="@drawable/card_bg"> <ImageView android:id="@+id/labelSource0001" android:background="@drawable/card_label" android:layout_height="wrap_content" android:layout_width="wrap_content" /> </RelativeLayout> </FrameLayout>
(
http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape에서이 코드를 가지고)
하지만 아무 일도 일어나지 않아 내 모양이 보이지 않고 내 카드 만 볼 수 있습니다. 내가 뭘 잘못하고 있는지 알고 싶다! shape.xml에서 모양 = "라인"라인 : http://imgur.com/8FckNgR
촬영 한 이미지를 업로드 할 수 있습니까? – dors
몇 시간 후에 집에 돌아 오면이 설명을 편집하여 처리하겠습니다. – guilhermexot
결과 : http://imgur.com/0oJN7Ef – guilhermexot