1

According to another StackOverflow question it's possible to remove the margin of a normal Button via styles.xml.

I would like to do the same for the margin/padding of Entry. Given that my trivial assumption would be that it uses an EditText beneath I tried:

  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="editTextStyle">@style/MyEditText</item>
  </style>

  <style name="MyEditText" parent="Widget.AppCompat.EditText">
    <item name="android:layout_margin">0dip</item>
  </style>

Unfortunately, this doesn't have any effect. Even when I use 50dip as a value there's no effect. What are the correct setting in styles.xml to affect the Entry-widgit?

Christian
  • 25,249
  • 40
  • 134
  • 225

1 Answers1

1

In your MainTheme.Base

<item name="android:editTextStyle">@style/EditTextStyle</item>

And your @style/EditTextStyle

<style name="EditTextStyle" parent="@android:style/Widget.EditText">
    <item name="android:layout_margin">0dip</item>
    <item name="android:padding">0dip</item>
</style>

Note: This going to depend upon your layout, as the "margins" are to parent Android layout containers (ViewGroup) and thus your Forms' Entry might not be effected. If you are not sure that you have set this up correctly, throw a color into the style to double check, something like all Entries having Green text:

<item name="android:textColor">#00f000</item>
Christian
  • 25,249
  • 40
  • 134
  • 225
SushiHangover
  • 73,120
  • 10
  • 106
  • 165