Tak więc mam ten plik układu (poniżej). Jak widać, nie ma dopełnienia ani marginesu. Pliki dimen.xml również nie mają żadnego dopełnienia/marginesu. Na koniec NIE zmieniam programowo wcale.Układ Android niechciane wyściełanie
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:padding="0dp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/toolbarholder"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="16dp"
app:cardCornerRadius="0dp">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
</android.support.v7.widget.Toolbar>
</android.support.v7.widget.CardView>
<ListView
android:layout_below="@+id/toolbarholder"
android:layout_above="@+id/cardroot"
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:divider="@null"
android:dividerHeight="0dp"
android:layout_marginTop="0dp" />
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardroot"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/transparentblack"
app:cardCornerRadius="0dp"
app:cardElevation="16dp"
android:layout_alignParentBottom="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/buttonholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:weightSum="3">
<ImageView
android:id="@+id/previous"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/previous"
android:layout_weight="1"/>
<ImageView
android:id="@+id/play"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/play"
android:layout_weight="1"/>
<ImageView
android:id="@+id/next"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/next"
android:layout_weight="1"/>
</LinearLayout>
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/buttonholder" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Poniżej znajdują się dwa zrzuty ekranu z dwóch różnych urządzeń.
Lenovo K3 Uwaga:
HTC Desire 550:
jakieś pomysły co może być przyczyną tego?
Dlaczego umieszczasz swój "Pasek narzędzi" wewnątrz karty? A nie tylko na układzie? I czy to twój pełny XML? Czy są jakieś układy nadrzędne? Czy to jest "Activity" czy "Fragment"? – Mauker
To "sztuczka/hack" używam, aby zapewnić atrybut "elewacji" dla paska narzędzi, dla urządzeń pre-Lollipop. Ponieważ pasek narzędzi Toolbar nie obsługuje atrybutu elewacji, ale robi to biblioteka pomocnicza Cardview. – Cbr
O, widzę. Ciekawe rozwiązanie;) – Mauker