材料设计圆形工厂

时间:2016-04-21 16:55:22

标签: android material-design floating-action-button

我正在尝试学习圆形工厂但我在设置

时遇到错误
final ImageView fabIconNew = new ImageView(this);
    fabIconNew.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_new));
    final FloatingActionButton rightLowerButton = new FloatingActionButton.Builder(this)
            .setContentView(fabIconNew)
            .build();


    SubActionButton.Builder rLSubBuilder = new SubActionButton.Builder(this);
    ImageView rlIcon1 = new ImageView(this);
    ImageView rlIcon2 = new ImageView(this);
    ImageView rlIcon3 = new ImageView(this);
    ImageView rlIcon4 = new ImageView(this);



    rlIcon1.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_contact));
    rlIcon2.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_currency_info));
    rlIcon3.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_exhibition));
    rlIcon4.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_faq));

我在Builder上遇到错误(这个) 它显示无法解析符号生成器 我想从这里制作圆形按钮https://github.com/oguzbilgener/CircularFloatingActionMenu 我添加了编译时依赖项 有人可以告诉我如何解决这个错误

1 个答案:

答案 0 :(得分:1)

您尝试使用的FloatingActionButton来自com.android.support:design,它没有Builder()方法。

您需要使用FloatingActionButton中的com.oguzdev:CircularFloatingActionMenu

删除import android.support.design.widget.FloatingActionButton;并添加

import com.oguzdev.circularfloatingactionmenu.library.FloatingActionButton;

您想要使用com.oguzdev:CircularFloatingActionMenu' s FloatingActionButton

的任何地方