반응형
레이아웃 배치를 할때 오른쪽에 일정 공간을 확보하고 싶었다..
그런데 그게 내 맘대로 안 되네 -_-a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello" />
<TextView
android:id="@+id/tv1"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:text="hi"
/>
</LinearLayout>
이렇게 하는 넘이랑.. 밑에 처럼 하는 거랑 다르다..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/tv1"
android:layout_width="200sp"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hi"
/>
</LinearLayout>
fill_parent 가 앞에 나오느냐 뒤에 나오느냐에 따라서 다른 거시기가 된다.
fill_parent가 앞에 나오면 뒤에 200sp가 있던지 말던지 간에 지 혼자 화면을 다 차지 한다.
뒤에 나오면 앞에 200sp가 확보된 공간을 냄겨두고 나머지를 지가 먹는다.
layout_weight를 주는 방법도 있는데.. 에뮬레이터랑 실제 폰으로 옮겨서 해 보는 거랑은 또 다르다.
.. 알 수가 없다. 어렵 -_-
분명히 다른 방법이 있을 것 같은데.. 당췌 알 수가 없다 ㅋㅋㅋㅋㅋㅋ
반응형
'TechNical > Android' 카테고리의 다른 글
Android] HTC 디자이어 HD USD 디버깅 하기 (4) | 2011.08.03 |
---|---|
Android] 해상도에 따라 레이아웃 병신되는 이유.. (15) | 2011.08.02 |
Android] 핸들러를 이용해서 타이머를 만들어 보자. (2) | 2011.06.27 |
Android] GridView를 써 보자. (1) | 2011.06.02 |
sdk업뎃을 했더니 AVD매니저가 실행이 안 되네 -_- (0) | 2011.05.08 |
댓글