Атрибут 'style' не объявлен - PullRequest
0 голосов
/ 25 июня 2018

Блоки кода в моем activity_main.xml с ошибками выглядят следующим образом:

<EditText
    style="@style/editText_style"
    android:inputType="textEmailAddress"
    android:id="@+id/editText1" />
<EditText
    style="@style/editText_style"
    android:inputType="textPassword"
    android:id="@+id/editText2" />

Код в моих стилях выглядит следующим образом:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    <style name="editText_style">
      <item name="android:gravity">center</item>
      <item name="android:background">@drawable/editText_background</item>
      <item name="android:layout_width">match_parent</item>
      <item name="android:layout_height">match_parent</item>
      <item name="android:ems">10</item>
      <item name="android:layout_margin">10dp</item>
    </style>
</resources>

Я получаю сообщение об ошибке: Атрибут 'style' не объявлен. Я не понимаю, что не так. Любая помощь приветствуется. Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...