Issue
I have a AppCompatCheckBox in my layout. This is how it looks like:
The problem is the padding or margin or gravity is not the way I want it to be. There is a small gap between the Box and the left border. I set gravity to left/start paddding and margin to 0 but the gap still exists. How can I remove this? I want it to be completely at the left border or centered. Both would be okay. But set gravity to center does not work, too.
Anyone has an idea?
The CheckBox and the Text should be above each other.
<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>
Solution
Was not a problem of the AppCompatCheckBox but of the CheckBox itself. The only solution I found is to set negative margin (for me -7dp was great).
Answered By - L3n95
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.