0
private FloatingActionButton createButton(int id) {
FloatingActionButton fab = new FloatingActionButton(this);
fab.setId(id);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("Entrei truta");
}
});
fab.setImageResource(R.drawable.ic_delete);
RelativeLayout.LayoutParams lay = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lay.addRule(RelativeLayout.BELOW, buttonAddCardapio.getId());
lay.addRule(RelativeLayout.RIGHT_OF, editTextCardapioHora.getId());
lay.addRule(RelativeLayout.END_OF, editTextCardapioHora.getId());
fab.setLayoutParams(lay);
return fab;
}
I’m trying to create a button FloatingActionButton
on Android but I can’t set the size of the button or something like that app:fabSize="mini"
because it does not have the method setSize
and neither the Enum
FloatingActionButton.SIZE_MINI
.
This option does not appear here. I tried using maybe it could be version
– Victor César
@Victorcésar managed to solve the problem?!
– viana
I managed to solve the problem. I was on sdk 23 I changed to 25 and so the methods appeared.
– Victor César