안드로이드 개발 질문/답변
(글 수 45,052)
세로 해상도별로 "dp"를 처리할수 있게
##################################################
/res/values-port-800x480
- strings.xml
<dimen name="test_top">19dp</dimen>
/res/values-port-854x480
- strings.xml
<dimen name="test_top">25dp</dimen>
##################################################
ui.xml ------------------------------------------------------------------------------
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/test_top"
android:layout_marginLeft="18dp"
android:orientation="horizontal">
..... 생략
------------------------------------------------------------------------------------
폴더를 만들고 값을 선언해서 실행을 시키면
아래와 같은 에러가 발생을 합니다.
java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
이유가 뭘까요
##################################################
/res/values-port-800x480
- strings.xml
<dimen name="test_top">19dp</dimen>
/res/values-port-854x480
- strings.xml
<dimen name="test_top">25dp</dimen>
##################################################
ui.xml ------------------------------------------------------------------------------
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/test_top"
android:layout_marginLeft="18dp"
android:orientation="horizontal">
..... 생략
------------------------------------------------------------------------------------
폴더를 만들고 값을 선언해서 실행을 시키면
아래와 같은 에러가 발생을 합니다.
java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
이유가 뭘까요