https://kotlinlang.org logo
#android
Title
# android
v

vs.thaakur

03/16/2020, 8:44 AM
Hi everyone I am creating a custom BottomBar by extending
BaseTransientBottomBar
. But it is taking bottom Margin I want it to stick to bottom but it takes some default Bottom Margin. I am using below code to remove the bottom margin
Copy code
(view.layoutParams as MarginLayoutParams).setMargins(margin10, 0, margin10, 0)
Is there any way to remove the bottom margin?
f

Francisco Javier Ruiz Rodriguez

03/16/2020, 9:41 AM
Are you testing in an android 10 device?
v

vs.thaakur

03/16/2020, 12:20 PM
No. In APi 24
Moreover by code its not working I tried adding in style then it worked partially
I mean in style if I set layoutmargin 0 then only it works but If I add layout_marginStart it doesnot work
I have to remove bottomMargin from style and using layout_margin and then giving Side margins in code
Thats a little wierd
If you have any other way to implement then please let me know
f

Florent Maufras

03/16/2020, 1:44 PM
Have you checked if there is any default padding?
5 Views