저는 비디오 렌더링을위한 표면 뷰와 해당 참가자 호출을 끝내기위한 버튼이있는 framelayout을 가지고있는 videoconference APP를하고 있습니다.Android : 레이아웃 레이아웃을 동적으로 레이아웃 레이아웃으로 사용하기
참가자가 동적으로 추가 될 수 있으므로 요청이 새로운 사용자를 생성 할 때이 레이아웃을 부풀려 야합니다.
이 팽창 된 레이아웃은 내가 레이아웃 한 많은 레이아웃/사용자를 수용 할 수 있도록 tablelayout에 추가됩니다.
나는 같은 FrameLayout이 팽창하고있다 :
participantHolder.mParticipantFrameLayout = (FrameLayout)mInflater.inflate(R.layout.generic_paritcipant_layout, null);
을 내가 사용이 레이아웃 내부 표면보기 버튼을 얻고있다 :
//get the Dropuser button
participantHolder.mParticipantDropButton = (ImageButton)mFrameLayt.findViewById(R.id.ParticipantDropButton);
//get the surfaceview
participantHolder.mParticipantSurfaceView = (SurfaceView)mFrameLayt.findViewById(R.id.ParticipantSurfaceView);
및 레이아웃 PARAMS을 설정하여 테이블 행에 레이아웃을 추가 .
TableRow.LayoutParams PreviewLayoutParams = new TableRow.LayoutParams(0, TableRow.LayoutParams.MATCH_PARENT);
첫 번째 인수 수단 :
TableRow.LayoutParams PreviewLayoutParams = new TableRow.LayoutParams(0, TableRow.LayoutParams.MATCH_PARENT);
PreviewLayoutParams.weight = 1;
CurrentParticpant.mParticipantUIHolder.mParticipantFrameLayout.setLayoutParams(PreviewLayoutParams);
CurrentParticpant.mParticipantUIHolder.mParticipantFrameLayout.invalidate();
mTableRowOne.addView(CurrentParticpant.mParticipantUIHolder.mParticipantFrameLayout);
mTableRowOne.invalidate();
mTableLayoutReference.invalidate();
그러나 잘못 어떤 것을
'mParticipantDropButton'과'mParticipantSurfaceView'가'mParticipantFrameLayout' 안에 있지 않아야합니까? – nikis
여기 mFrameLayt는 아무 것도 아니지만 mFrameLayt = participantHolder.mParticipantFrameLayout으로 참조하고 있습니다. 둘 다 같음 – user954299