当前位置: 代码迷 >> 综合 >> android.app.ActionBar $LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
  详细解决方案

android.app.ActionBar $LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams

热度:3   发布时间:2023-12-17 21:59:23.0

错误提示:

android.app.ActionBar $LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams



修改方法:

将原来import的LayoutParams库android.app.ActionBar $LayoutParams删除,将android.widget.FrameLayout imoort进来即可。



===================================================================================

错误提示:

android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams


修改方法:

LayoutParams topBarPara= (LayoutParams)topBar.getLayoutParams();

改为:

ViewGroup.LayoutParams topBarPara= (ViewGroup.LayoutParams)topBar.getLayoutParams();

  相关解决方案