我的佈局中有一個AppCompatCheckBox。這是它的樣子:Android AppCompatCheckbox填充/邊距/重力
問題是填充或保證金或重力是不是我希望它的方式。 Box和左邊框之間有一個小小的差距。我將重力設置爲左/開始paddding和餘量爲0,但差距仍然存在。我該如何刪除它?我希望它完全處於左邊界或居中。兩者都可以。但是,將重心設置爲中心也不起作用。
任何人有一個想法?
複選框和文本應該在彼此之上。
<LinearLayout
android:id="@+id/llRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/llCbs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/textColor" />
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/textColor" />
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/textColor" />
</LinearLayout>
<LinearLayout
android:id="@+id/llTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
請爲您提供佈局XML,這將幫助我們幫助您。 –
這很可能是可繪製的內在填充;即盒子和圖像邊緣之間的空白空間。你可能可以在'View'上使用一個負的左/開始填充,但這真的很糟糕。處理它的最好方法可能是提供你自己的drawable。 –
發佈您的* xml *代碼。 –