안드로이드 개발 질문/답변
(글 수 45,052)
검색 창을 만드는데 디자인이 영 어렵네요.
아래처럼 구성되어있는데 모양이 이상하게 되네요 ㅠ,ㅠ
[이미지] [입력창][버튼]
웹으로 따지면
<TABLE width='100%'>
<TR>
<TD width='32'>책이미지</TD>
<TD><input type=text style='wdith:100%'></TD>
<TD width='32'>검색버튼</TD>
</TR>
</TABLE>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="2px"
android:background="#A5A5A5"
>
<ImageView android:id="@+id/searchTitle"
android:src="@drawable/search_book"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:layout_alignBottom ="@id/sbtn"
/>
<EditText android:id="@+id/searchText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="#330066"
android:background="#C2C2C2"
android:height="32pt"
android:layout_toRightOf="@id/searchTitle"
android:layout_alignBottom ="@id/sbtn"
/>
<ImageButton android:id="@+id/sbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search_btn"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
</LinearLayout>
아래처럼 구성되어있는데 모양이 이상하게 되네요 ㅠ,ㅠ
[이미지] [입력창][버튼]
웹으로 따지면
<TABLE width='100%'>
<TR>
<TD width='32'>책이미지</TD>
<TD><input type=text style='wdith:100%'></TD>
<TD width='32'>검색버튼</TD>
</TR>
</TABLE>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="2px"
android:background="#A5A5A5"
>
<ImageView android:id="@+id/searchTitle"
android:src="@drawable/search_book"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5px"
android:layout_alignBottom ="@id/sbtn"
/>
<EditText android:id="@+id/searchText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="#330066"
android:background="#C2C2C2"
android:height="32pt"
android:layout_toRightOf="@id/searchTitle"
android:layout_alignBottom ="@id/sbtn"
/>
<ImageButton android:id="@+id/sbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search_btn"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
</LinearLayout>
2010.11.15 22:14:55
제대로 동작은 하나요?
RelateveLayout으로 위치를 잡을때 아마 도? 상대 위치를 읽어서 (layout_alignBottom 요런거)
넣기때문에
<meta charset="utf-8"> <ImageButton android:id="@+id/sbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search_btn"
android:layout_alignParentRight="true"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search_btn"
android:layout_alignParentRight="true"
/>
요부분이 이걸 읽는 곳보다 위에 있어야 될꺼 같은데...^^;; 아닌가요?



