logo
down
shadow

Android layer-list affecting position of floating action button


Android layer-list affecting position of floating action button

Content Index :

Android layer-list affecting position of floating action button
Tag : android , By : Mark W
Date : January 12 2021, 07:00 PM

I wish did fix the issue. I am creating an app where a layer-list is used as background and a floating action button is also used. When the layer-list is set as the background of the relative layout, it changes the position of the FAB, but I cannot understand why it happens. , Try to change your layout like below:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/home_layer_list">

        <TextView
            android:id="@+id/text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="hello world"
            android:textColor="@color/colorPrimary"
            android:textSize="36sp"
            android:textStyle="bold" />
    </RelativeLayout>

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:src="@drawable/ic_fab"
        android:layout_margin="16dp"
        app:backgroundTint="#FFFFFF" />

</RelativeLayout>

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Android floating action button not returning to initial position


Tag : android , By : Igor Carron
Date : March 29 2020, 07:55 AM
around this issue I didn't realise I had this problem until I saw your post, but it happens in my app too.
Looking at the FloatingActionButton source I see that they set the translationY of the FAB based on the Snackbar, but only if the FAB is visible. If the FAB is not visible, the translationY is not changed and so depending on when it is hidden and shown it could end up stuck in the wrong position.
Snackbar snack;
snack.make(...etc...).show();
        if(snack != null){
            if(!snack.isShown()) {
                //if the snackbar is not shown, make sure the fab is at the
                //original location
                fab.setTranslationY(0.0f);
            }
        }
        fab.show();

How to set the fixed position for floating action button above very long listview in Android?


Tag : android , By : Nick Pegg
Date : March 29 2020, 07:55 AM
it should still fix some issue Try using RelativeLayout instead of LinearLayout. And for FloatingActionButton add attribute like this,
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_gravity="end|bottom"

How to position Android Floating Action Button on Seam


Tag : android , By : foxthrot
Date : March 29 2020, 07:55 AM
I wish this helpful for you Try using RelativeLayout instead of LinearLayout. And for FloatingActionButton add attribute like this,
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="end|bottom"

fixed position floating action button like gmail android


Tag : android , By : Robert MacGregor
Date : March 29 2020, 07:55 AM
wish helps you I have a scrollview with three view pagers inside a fragment container.I want to place a fixed floating action button like gmail inbox at the bottom right of the page and not in bottom right of the scrollview.It should be fixed whether I scroll or not.I am posting my drawer layout xml file.please help me , You need to use CoordinatorLayout
main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.c217.reddyteacherapp.baseActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <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/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_base" /> 

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>

Ionic 3 - FAB - Floating Action Button - <ion-fab> Complete list of possible position attributes


Tag : development , By : Matt Leacock
Date : March 29 2020, 07:55 AM
I wish this help you https://github.com/ionic-team/ionic/blob/master/src/components/fab/fab-container.ts
@property [top] - Places the container on the top of the content @property [bottom] - Places the container on the bottom of the content @property [left] - Places the container on the left @property [right] - Places the container on the right @property [middle] - Places the container on the middle vertically @property [center] - Places the container on the center horizontally @property [edge] - Used to place the container between the content and the header/footer
Related Posts Related QUESTIONS :
  • Koin: NoBeanDefFoundException, Check your module definitions
  • How to Ensure View is Removed After Animation on repeated touches
  • Differentiate ambiguous Extensions in Kotlin
  • Firestore how to putExtra object using Geopoint
  • Apple Maps and Google Maps API feasibility
  • Jetpack Navigation: Hide label in toolbar
  • get thumbnail from video URL but it takes more than 5 seconds to load data on recycler view
  • How to fix 'Android SDK not found at this location' error while installing flutter?
  • Android Shared Storage protection issue
  • How can I clone views using java code in Android Studio
  • Hide title and action bar for splash screen and remove White screen in start
  • Why can not hashing key android for facebook
  • Can not create handler inside thread that has not called Looper.prepare()
  • ID of the child views in a custom view are same in Android
  • Android: unable to hide appbar on scrolling
  • Best layout for form-style screen
  • How To create multiple function in Adapter Class Android with Retrofit
  • Can the Android Flow virtual layout handle variable-width Views
  • How to fix "Unable to load class 'dagger.Multibindings'" due to problems with gradle
  • VpnService always-on "not supported by this app"
  • Android Studio - Gradle "Sync now" is not Available
  • How do i get my code to give my current location?
  • Could not initialize class sun.util.calendar.ZoneInfoFile while using Flutter firebase-notifications
  • How to implement circular to check / tick animation in Android?
  • Toolbar shadow not showing
  • Android Sqlite get rows where first character is not an Alphabet
  • why I receive "bad request" in my request by retrofit
  • Intercept NavigationUI.onNavDestinationSelected() to make backstack pop with "inclusive = true"
  • I have a problem with the navigation fragments in my proyect, it sais that I need a defaut nav host atribute but I alrea
  • How can I keep a BottomSheetDialogFragment height to always match_parent?
  • How to reference a timerPicker in android studio using kotlin
  • Firebase Crashlytics - get stacktrace info to display during CrashlyticsListener.crashlyticsDidDetectCrashDuringPrevious
  • Schedule a repeating alarm clock
  • Can't assign values outside onTouchListener
  • Is setContentView() needed to inflate a fragment?
  • Why instead of string method returns Kotlin.Unit?
  • Retrofit slash as Query
  • When does onCreateView() get called in this app?
  • Fragment is reloaded each time after rejecting location permission
  • How to read ViewModel data from sttrings.xml list of items
  • Flutter doctor does not see vs code ,VS code does not detect flutter/bin
  • How to build aar in flutter
  • Is displayMetrix xdpi and ydpi accurate?
  • How to detect doubletap on a View?
  • how to play an encrypted file in Android
  • Android: keytool error on the command line when locating debug.keystore
  • Android paint/canvas issue; drawing smooth curves
  • Problems with starting an activity in onStart
  • Performance of map overlay in conjunction with ItemizedOverlay is very poor
  • How to change android indeterminate ProgressBar color?
  • How do I change the Mobile Country Code (MCC) in the Android Emulator?
  • Stop Progressbar manual scrolling in Android
  • Android: download large file
  • Android : uploaded .apk file to server but cant download that .apk file
  • How do I distribute Android app to beta tester without using Market
  • Android Unable to launch the Inbox from a notification
  • Android: Ringer mode changed to silent doesn't stop the phone vibrating
  • Change the side the text appears on a radio button
  • Check the memory usage anp cpu and power of an application in android
  • What is the String 'volumeName' argument of MediaStore.Audio.Playlists.Members.getContentUri referring to?
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com