<?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"
android:background="#ff0000">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:background="#000000"/>
<Button android:text="button 1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<Button android:text="button 2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
public class ButtonTest extends Activity {
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.buttontest);
}
}
//해당 코드 실행화면은 캡쳐해서 첨부했습니다.
위의 코드를 보면 LinearLayout에 버튼을 두개 선언했습니다.
버튼에 따로 여백준게 없는데 상하좌우여백이 들어갑니다.
위젯들을 여백없이 붙이거나,
width/height를 layout에 가득채우고 싶은데 어떻게해야하나요?
혹시 다른 Layout을 사용해야되는건가요?
아니면 Button(ImageButton)에 설정이 있는건가요?
-----
ImageButton의 경우 selector을 생성해서 src에 넣으면 버튼에 생성되던 여백은 없어집니다.
하지만 버튼의 상태별 이미지가 각각 있어야 하는데 이미지가 없어서 이방법은 지금 사용을 못하고있습니다.
이런 방법을 제외한 다른 방법을 알고싶네요.
margin이나 padding에 -값이 들어갈수 있는지는 잘 모르겠네요...