0
我製作的在該庫的幫助下向上滑動面板。點擊here現在我試圖在用戶打開面板或關閉時逐漸改變頂部滑動面板的顏色。下面的代碼,我用下面的代碼改變閃光燈的顏色。 如何逐漸改變顏色?逐漸改變顏色
@Override
public void onPanelLayout(View panel, SlidingUpPanelLayout.PanelState state) {
LinearLayout titleBar = (LinearLayout) getView().findViewById(R.id.dragView);
if(state == SlidingUpPanelLayout.PanelState.COLLAPSED){
titleBar.setBackgroundColor(Color.parseColor("#03A9F4"));
}
else if (state == SlidingUpPanelLayout.PanelState.ANCHORED || state == SlidingUpPanelLayout.PanelState.ANCHORED){
titleBar.setBackgroundColor(Color.parseColor("#ffff9431"));
}
}
感謝您的任何幫助和想法!