我的片段中有浮动的操作按钮。如何使用此浮动操作按钮启用或禁用回收器视图中的复选框。回收器视图和浮动操作按钮都在同一个片段活动中。另外,我需要隐藏这个浮动的动作按钮在回收站滚动。
发布于 2017-11-23 17:16:19
例如,如果你想在你的布局中以片段的形式添加一些东西,你可以这样做:
LinearLayout linearLayoutFragment = (LinearLayout)findViewById(R.id.fragmentLayout);
Button button = (Button)findViewById(R.id.buttonid);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//if you want to add something to your Linearlayout fragment
//remove all views for example
linearLayoutFragment.removeAllViews();
}
});
https://stackoverflow.com/questions/47451391
复制相似问题