Open DamineBO opened 9 years ago
You have to set the attributes fab:fab_labelStyle and fab:fab_labelsPosition in your view layout. Good Luck !
@MaherSakka Thanks for replying however I don't want to add these fab buttons in XML, I want to add them in my java code. I think that this is the right code :
button.setTitle("btn_title");
And I dont know why this don't works with me
I also had the same problem. What worked me for me was adding button to menu after setting the text using setTitle().
In FloatingActionsMenu:
@Override protected void onFinishInflate() {
super.onFinishInflate();
bringChildToFront(mAddButton);
mButtonsCount = getChildCount();
if (mLabelsStyle != 0) {
// here is important. // As MaherSakka said, you should set the attributes fab:fab_labelStyle and fab:fab_labelsPosition in //your view layout !!! for FloatingActionsMenu !!!. //,otherwise, it will not create lables for you button
createLabels();
}
}
Hello all, I must say that this is not the answer for the question DamineBO asked. I also need to set the title but I don't use XML for layout. My application is completely dynamic, and everything is created from JSON, so my layouts are all in java code. If someone could help it'll be nice. Thanks in advance!
Just change your XML
<com.getbase.floatingactionbutton.FloatingActionsMenu android:id="@+id/add_req" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" app:fab_labelsPosition="left" app:fab_labelStyle="@color/black"/>
It didn't work for me either.
So I just set fab:fab_title=""
in XML layout and all set_title()
s worked fine.
Hi I have title problem for my fab, I try with settext() fab:fab_title and none of them work for me. Is there any stable solution?
Hello ! Fist of all I want to thank you so much for this useful library. My problem here is that I want to add a fab menu with some fab buttons in my activity.java not in xml file :
There is no title like in the screenshot :(
Can you help to fix this please :) I don't want to fix this in the xml file