我的问题与this有关.
当我打开NavigationDrawer时,浮动按钮位于其顶部,但必须位于下方.
我尝试这样做:
@Override
public void onDrawerSlide(View drawerView,float slideOffset) {
Log.i(TAG," inner onDrawerSlide");
super.onDrawerSlide(drawerView,slideOffset);
fabButton.setAlpha(25);
float alpha = 0.2f;
AlphaAnimation alphaUp = new AlphaAnimation(alpha,alpha);
alphaUp.setFillAfter(true);
fabButton.startAnimation(alphaUp);
syncState();
}
和那样:
@Override
public void onDrawerSlide(View drawerView,float slideOffset) {
super.onDrawerClosed(view);
invalidateOptionsMenu();
fabButton.setAlpha(255);
syncState();
}
没有什么对我有用.什么可以解决方案?
我的布局:
FragmentNavigationDrawer是自定义的DrawerLayout
最佳答案
来自Android documentation for setAlpha(float alpha)(自API 11起):
Sets the opacity of the view. This is a value from 0 to 1,where 0
means the view is completely transparent and 1 means the view is
completely opaque.
你试图将它设置为值25或255