0

編集:私の主な目標は、ボタンの背後に白い背景があるようにすることです。これにより、ボタンの背後にある白い背景のように見えます

ボタンで FrameLayout を完全に埋めることができないようです。

カプセル化する FrameLayout のパディングを 0dp に設定した後でも (負の dp 値も試しました)、ボタンの周りに 2dp の太さの白い境界線が表示されます。

ボタンが FrameLayout を完全に埋めるわけではありません。

コード:

 <FrameLayout
        android:background="#FFFFFF"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="0dp"
        android:layout_gravity="top"
        android:padding="0dp">
    <Button
        android:id="@+id/create_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="true"
        android:layout_gravity="top"
        android:drawableLeft="@drawable/plus"
        android:hint="Create List"
        android:text="@string/lists_create" />
    </FrameLayout>
4

1 に答える 1

0

このようなコードを書くことができます

  <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
    <Button 
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="@string/button_send"
        android:onClick="sendMessage"/>
</FrameLayout>
于 2013-07-17T15:22:04.013 に答える