question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adjust Icon in FloatingActionButton to occupy entire width and height?

See original GitHub issue

I am using the FloatingActionsMenu and under which there are two FloatingActionButton(s).

I am using a drawable icon for one of the FloatingActionButton.

Markup below.

<com.getbase.floatingactionbutton.FloatingActionsMenu
        android:id="@+id/multiple_actions"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_margin="16dp"
        fab:fab_addButtonColorNormal="@color/white"
        fab:fab_addButtonColorPressed="@color/white_pressed"
        fab:fab_addButtonPlusIconColor="@color/half_black"
        fab:fab_labelStyle="@style/FABLabelStyle">

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/action_dry_cleaning"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_icon="@drawable/ic_dry_cleaning"
            fab:fab_colorNormal="@color/white"
            fab:fab_title="Dry Cleaning"
            fab:fab_size="mini"
            fab:fab_colorPressed="@color/white_pressed"/>

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/action_wash_and_iron"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_icon="@drawable/ic_add"
            fab:fab_colorNormal="@color/white"
            fab:fab_title="Wash and Iron"
            fab:fab_size="mini"
            fab:fab_colorPressed="@color/white_pressed"/>

</com.getbase.floatingactionbutton.FloatingActionsMenu>

UI below. image

I want the image in the first FloatingActionButton to fitXY. How do i do this?

I have tried setting scaleType=“fitXY”. It doesn’t work. Please Help.

Thank you.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
RupeshYadavcommented, Dec 7, 2017

Make this entry in dimens

<dimen name="design_fab_image_size" tools:override="true">36dp</dimen>

Ex

<resources xmlns:tools="http://schemas.android.com/tools"> <dimen name="fab_margin">16dp</dimen> <!--Floating action button--> <dimen name="design_fab_image_size" tools:override="true">42dp</dimen> </resources>

You can adjust its size according to your need.

0reactions
MyGitUserAcccommented, Jun 29, 2019

@sytolk I want to reduce the spacing between FloatingActionsButton, How should i do this???

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the size of FloatingActionButton?
Set width and height using MediaQuery which will be same across the devices. Output: enter image description here. Share.
Read more >
Adjust Icon in FloatingActionButton to occupy entire width and ...
I am using the FloatingActionsMenu and under which there are two FloatingActionButton(s). I am using a drawable icon for one of the ...
Read more >
Buttons: floating action button - Material Design
The FloatingActionButton can be sized either by using the discrete sizing modes or a custom size. There are three app:fabSize modes: normal -...
Read more >
ListTile class - material library - Flutter - Dart API docs
A list tile contains one to three lines of text optionally flanked by icons or other widgets, such as check boxes. The icons...
Read more >
Ion-Grid: Display Grids to Build Mobile-First Custom App Layout
Grids take up the full width of their container, but adding the fixed property will set the width based on the screen size,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found