The two button
in the following code, were set to wrap_content
and no padding. However, there is still some padding in the vertical orientation. If I set the android:layout_height
to a fixed parameter, the padding could disappear. But I do want to use wrap_content
instead of a fixed height.
EDIT: Now, I have to use DIP, which is not recommended, as text size to ensure the text in the button while using a fixed height in DIP. Looking forward to a better solution!
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_marginLeft="5dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/account_balance"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvBa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:src="@drawable/video_list_price"/>
</LinearLayout>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/record_selector"
android:gravity="center"
android:textColor="#ffffffff"
android:text="@string/charge_record"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/charge_selector"
android:gravity="center"
android:textColor="#ffffffff"
android:text="@string/charge"/>
</LinearLayout>