浮动操作按钮大小在不同位置自动更改 。它工作得很好,但现在FAB在一些正常的地方改变了它的尺寸,在一些地方它看起来像一个句号。为什么不给你FAB的高度和宽度精确的尺寸。只需使用它36dp,将这个尺寸和你的宽度和高度以及android:scaleType=“
浮动操作按钮大小在不同位置自动更改浮动操作按钮大小在不同位置自动更改 。它工作得很好,但现在FAB在一些正常的地方改变了它的尺寸,在一些地方它看起来像一个句号。为什么不给你FAB的高度和宽度精确的尺寸。只需使用它36dp,将这个尺寸和你的宽度和高度以及android:scaleType=“,android,Android,浮动操作按钮大小在不同位置自动更改 。它工作得很好,但现在FAB在一些正常的地方改变了它的尺寸,在一些地方它看起来像一个句号。为什么不给你FAB的高度和宽度精确的尺寸。只需使用它36dp,将这个尺寸和你的宽度和高度以及android:scaleType=“center”我给了固定的尺寸,即使这样,它也不起作用。我能想到的唯一一件事是,您的RelativeLayout没有足够的空间来正确充气浮动操作按钮。该RelativeLayout的父视图有多大??为什么不给您精确的晶圆厂高度和宽度尺寸。只需使
。它工作得很好,但现在FAB在一些正常的地方改变了它的尺寸,在一些地方它看起来像一个句号。为什么不给你FAB的高度和宽度精确的尺寸。只需使用它36dp,将这个尺寸和你的宽度和高度以及android:scaleType=“center”我给了固定的尺寸,即使这样,它也不起作用。我能想到的唯一一件事是,您的RelativeLayout
没有足够的空间来正确充气浮动操作按钮。该RelativeLayout的父视图有多大?
?为什么不给您精确的晶圆厂高度和宽度尺寸。只需使用它36dp,并将此尺寸指定给您的宽度和高度,以及android:scaleType=“center”我指定的固定尺寸,即使这样,它也不起作用。我能想到的唯一一件事是,您的RelativeLayout
没有足够的空间来正确充气浮动操作按钮。该RelativeLayout
的父视图有多大?
<android.support.design.widget.FloatingActionButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/btnFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:elevation="6dp"
app:fabSize="normal"
app:pressedTranslationZ="6dp" />
<?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:id="@+id/empty_layout_qms"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/qms_empty_view_image"
android:layout_width="140dp"
android:layout_height="140dp"
android:layout_marginTop="60dp"
app:srcCompat ="@drawable/zero_query"
/>
<com.snapdeal.uimodule.views.SourceSansTextView
android:id="@+id/qms_zero_state_textView_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/zero_state_text_margin_top"
app:typeface="source_sans_medium"
android:gravity="center"
android:text="@string/qms_zero_state_text_header"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/color_dark_grey"
android:textSize="@dimen/zero_state_header_font_size" />
<com.snapdeal.uimodule.views.SourceSansTextView
android:id="@+id/qms_zero_state_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/zero_state_text_margin_top"
android:gravity="center"
android:text="@string/qms_zero_state_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/color_lablel_grey"
android:textSize="@dimen/zero_state_content_font_size" />
<com.snapdeal.uimodule.views.SourceSansButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/round_rect_shape"
android:textSize="@dimen/zero_state_content_font_size"
android:layout_marginTop="@dimen/zero_state_text_margin_disc"
android:textColor="@color/white"
android:paddingLeft="@dimen/fourty"
android:paddingRight="@dimen/fourty"
android:clickable="true"
android:paddingTop="@dimen/ten"
android:paddingBottom="@dimen/ten"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/zero_try_again"
android:gravity="center"
android:visibility="gone"
android:id="@+id/tv_zero_state_qms_action"
android:layout_centerHorizontal="true"
android:layout_below="@+id/qms_zero_state_textView"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="45dp"
android:visibility="gone"
android:layout_centerHorizontal="true"
android:layout_marginBottom="40dp"
android:id="@+id/temp_fab_view"
>
<ViewStub
android:id="@+id/fab_view_stub_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="@layout/zero_state_fab_layout" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="10dp"
android:layout_centerHorizontal="true"
android:textColor="@color/zero_disc"
android:text="Create Query"
android:elevation="7dp"/>
</RelativeLayout>
</LinearLayout>