당신은 가까이 이동 할 수 없습니다
이 버튼에 대한 내 XML이다. 귀하의 유일한 옵션은 당신이 그들을 가까이 함께 자신의 버튼을 구축해야 할 경우 :
<RelativeLayout
android:id="@+id/rlButton"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_text"/>
<ImageView
android:id="@+id/ivLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home_icon"
android:layout_toLeftOf="@id/tvText"/>
</RelativeLayout>
당신은 TextView
와 ImageView
사이의 거리를 제어하기 위해 마진을 사용할 수 있습니다.
RelativeLayour rlButton = (RelativeLayout) view.findViewById(R.id.rlButton);
rlButton.setOnClickListener(new OnClickListener() {
....
});
을하지만 물론 당신은 버튼과 동일한 모양 있도록 RelativeLayout의에 버튼 스타일을 적용해야한다 : 당신은 버튼으로 거의 동일하게 사용할 수 있습니다.