Używam kart podobnych do TabLayout do ViewPagera. Kiedy naciskam jakąś zakładkę, otrzymuję tło o dziwnym kolorze tabulatora. I niezależnie od tła TabLayout EditText również w dziwnym widoku. Wynik ten API 19. A w API 22 wszystko działa idealnie
Uszkodzone domyślne tła, takie jak EditText lub naciśnięty stan w TabLayout i pasku narzędzi
Po naciśnięciu przycisku wstecz w pasku mam podobny tło z dziwnym kolorze
Jest fragment xml gdzie używam TabLayout i Toolbar
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
android:layout_marginBottom="10dp"
/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
jest to fragment xml gdzie używam EditText
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Заполните поля чтобы войти"
android:textColor="@color/black"/>
<EditText
android:id="@+id/edt_firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Логин*"
android:textSize="15sp"
android:textColorHighlight="#F14040"
android:layout_marginTop="10dp"
style="@style/Base"
android:backgroundTint="@color/colorPrimary"
android:inputType="phone"
android:maxLength="13"
/>
<EditText
android:id="@+id/lastname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Пароль"
android:textSize="15sp"
android:textColorHighlight="#F14040"
android:layout_marginTop="10dp"
style="@style/Base"
android:backgroundTint="@color/colorPrimary"
android:inputType="textPassword"
/>
To jest mój styl xml
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="searchViewStyle">@style/SearchViewMy</item>
</style>
<style name="Theme.App.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">#c5c5c5</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimary</item>
</style>
I w jawnym ustawić
android:theme="@style/MyMaterialTheme"
Wygląda jak problem jest z wyprawą dziewięć krosowe tła. Zarówno domyślne tło edycji, jak i domyślne tło elementu klikalnego to dziewięć obrazów łat w motywach AppCompat. Chociaż nie mam pojęcia, dlaczego byłyby złamane. Możesz wypróbować czystą kompilację lub zaktualizować zależność AppCompat do nowszej wersji. Jesteś pewien, że to wszystko API 19? Może to tylko jedno wadliwe urządzenie? –
@ MarcinKoziński Tak dla wszystkich API poniżej 21, sprawdziłem to w API 16 (HTC), W API 17 (Samsung) pozostają problemy – eluuu
Jaki motyw jest ustawiony dla aktywności, którą wyświetlasz? Jakiej wersji AppCompat używasz? –