android:layout_alignParentBottom is ignored when used without explicit layout height as a row in ListView

前端 未结 4 1491
灰色年华
灰色年华 2021-02-13 15:40

When I use a RelativeLayout with either fill_parent or wrap_content as height and an element which specifies: android:layout_alignPa

4条回答
  •  再見小時候
    2021-02-13 16:22

    My hack for this andriod bug:

    ViewGroup.LayoutParams lp=(ViewGroup.LayoutParams)view.getLayoutParams();
    lp.height=view.getContentHeight();//hack for android bug about ViewGroup.LayoutParams.WRAP_CONTENT and android:layout_alignParentBottom="true" on landscape orientation
    view.requestLayout();
    act.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    

提交回复
热议问题