2016-09-15 5 views
1
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:orientation="vertical"> 
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/colorPrimary" 
    android:minHeight="56dp" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
    app:titleTextAppearance="@style/ToolbarTitle" > 
</android.support.v7.widget.Toolbar> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/myFAB" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentBottom="true" 
     android:layout_marginRight="8dp" 
     android:clickable="true" 
     android:layout_marginBottom="8dp" 
     android:src="@drawable/ic_fab_star" 
     app:borderWidth="0dp" 
     app:elevation="10dp" 
     /> 
    <RelativeLayout 
     android:id="@+id/relative6" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
    </RelativeLayout> 
    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_below="@id/relative6" 
     android:orientation="vertical"> 
     <ListView 
      android:id="@+id/list_history" 
      android:layout_width="match_parent" 
      android:layout_height="0dip" 
      android:layout_gravity="start" 
      android:layout_weight="1" 
      android:clickable="false" 
      android:cacheColorHint="@android:color/transparent" 
      android:choiceMode="singleChoice" 
      android:divider="@null" 
      android:dividerHeight="0dp" /> 
    </LinearLayout> 
</RelativeLayout> 
</LinearLayout> 

Thats мой XML, высота не работает до леденцов устройств.FloatingActionButton высота не работает на заранее леденец устройств

Прекрасно работает для новых устройств nexus 5, 6 i тестировал их.

Но не работал на старом устройстве, работающем комплектом kat.

Благодарим за помощь и плодотворную информацию.

+0

добавить эту строку в код приложения: fabSize = «нормальный» –

ответ

0

Просто установка app:borderWidth="0dp" решить эту проблему для меня.

Примечание: не забудьте добавить xmlns:app="http://schemas.android.com/apk/res-auto" в корневую компоновку.

его работы для меня

<android.support.design.widget.FloatingActionButton 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/your_id" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:layout_marginBottom="@dimen/floating_button_margin_bottom" 
     android:layout_marginRight="@dimen/floating_button_margin_right" 
     app:elevation="@dimen/floating_button_elevation" 
     app:borderWidth="0dp" 
     app:rippleColor="@color/your_ripple_color" 
     app:backgroundTint="@color/your_bg_color" /> 
+0

оно не решает для меня, я уже сделал это. проверьте мой код. –

+0

плавающая кнопка все еще находится под моим списком –

+0

попробуйте изменить родительский макет на ** RelativeLayout ** –