0
PercentRelativeLayout의 높이를 백분율로 설정하고 싶습니다.프로그래밍 방식으로 PercentRelativeLayout에서 percentHeight를 설정하는 방법
PercentRelativeLayout layout = new PercentRelativeLayout(this);
PercentRelativeLayout.LayoutParams llp = new PercentRelativeLayout.LayoutParams(PercentRelativeLayout.LayoutParams.MATCH_PARENT, 50%);
layout.setLayoutParams(llp);
myLayout.addView(layout);
MatchParent 또는 Wrap_Content가 아닌 LayoutParams에서 percentHeight (50 %)를 사용한다고 가정합니다.
나는 코드를 시도했지만 작동하지 않습니다. 이 줄 어디 엔 오류가 있습니다.'PercentLayoutHelper.PercentLayoutInfo info = params.getPercentLayoutInfo(); ' –
@elbertrivas 업데이트 됨. – azizbekian
정말 고마워요! –