xml 형식을 그릴 수 있습니까? 그 모양의 배경으로 png를 사용할 수 있습니까? 나는 이미 둥근 모서리가있는 사각형을 가지고 있으며 그 사각형에 배경을두고 싶습니다.안드로이드 모양 배경
37
A
답변
68
예 모든보기의 배경으로 모든 모양 파일을 사용할 수 있습니다. 이 샘플은 둥근 배경을 백색 색상으로하고 검은 색 테두리를 모양 주위에 만듭니다.
샘플 : 유로 사용할 수 있습니다
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
<stroke
android:width="0.5dp"
android:color="@color/color_grey" />
<solid android:color="@color/color_white" />
</shape>
rounded_corner.xml,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:background="@drawable/rounded_corner"
android:orientation="vertical" >
+2
을 투표하면 drawable 즉 이미지를 넣을 수 있습니까? –
+0
아니요 당신은 shape xml에 drawable을 추가 할 수 없습니다. –
+1
OP는 .png 이미지를 배경으로 유지하려고합니다. –
1
//이 나중에 당신을
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
android:padding="2dp"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/yourdrawable />
</LinearLayout>
관련 문제
- 1. UISearchBar : 모양 변경 - 배경, 배경, 오버레이
- 2. 특정 모양 (예 : 다이아몬드 모양)의 배경 포함
- 3. 안드로이드 : 배경
- 4. 안드로이드 배경
- 5. 안드로이드 SDK의 중첩 된 모양
- 6. 안드로이드 ListView를 빠르게 스크롤 모양
- 7. 안드로이드, 버튼 - 사용자 정의 모양
- 8. 안드로이드 모양 버튼 히트 영역
- 9. 안드로이드 모양 비주얼 편집기가 있습니까?
- 10. 배경 CSS "모양"이있는 중앙 텍스트
- 11. 배경 음악 안드로이드
- 12. 안드로이드 : 표준 '다음'버튼과 배경
- 13. 안드로이드 드로잉 - 배경 캐싱
- 14. ListView 안드로이드 배경
- 15. 안드로이드 타일 배경
- 16. 안드로이드 배경 화면 채우기
- 17. 라이브 배경 화면은 안드로이드
- 18. 안드로이드 배경 작업 시나리오
- 19. 안드로이드 뷰 배경 삭제
- 20. 안드로이드 배경 이미지 오류
- 21. 이동 배경 안드로이드
- 22. 배경 이미지 크기, 안드로이드
- 23. 안드로이드 webview 고정 배경
- 24. 안드로이드 ListView 영구 배경
- 25. 안드로이드 기본 설정 카테고리 모양/느낌을 에뮬레이트하십시오.
- 26. 안드로이드 드로잉 모양 : 사각형을 사각형으로 만들기
- 27. 안드로이드 : 모양 드롭 다운 스피너 배경 현재 내 스피너의 배경이 XML을 사용하고
- 28. 메뉴 모양
- 29. 안드로이드 - 사용자 정의 모양 버튼의 클릭 영역의 투명도를 감지하는 방법
- 30. 안드로이드 xml 라이브 배경 화면
도움이 될 것입니다이 방법을 시도 할 수있어. –
투표를 거칠 이유가 없습니까? –
나는 누군가가 왜 –