마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

videoview 크기 질문!ㅠㅠ [closed]

0 추천
public class VideoHelper extends VideoView {
    private int mVideoWidth;
    private int mVideoHeight;
    public VideoHelper(Context context){
        super(context);

    }
    public VideoHelper(Context context,AttributeSet attrs) {
        super(context, attrs);
    }
    public VideoHelper(Context context,AttributeSet attrs,int detStyle){
        super(context,attrs,detStyle);

    }
    public void setVideoSize(int width,int height){
        mVideoHeight=width;
        mVideoHeight=height;
    }
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width = getDefaultSize(mVideoWidth, widthMeasureSpec);
        int height = getDefaultSize(mVideoHeight, heightMeasureSpec);
        setMeasuredDimension(width, height);
    }



}

안녕하세요 단순히 이미지뷰처럼 비디오뷰는 크기조절이안되더라구요!ㅠㅠ 그래서 구글링해서

찾아낸방법으로 한건데 저 코드대로하면 완전히 꽉차더라구요.. 뷰를 xml파일마다 크기 변동이있는데

아예다차버리니... 여기서 코드로 바꿔주면 xml도 바뀌던데 xml파일에 비디오뷰 크기잡아준대로 그 안에서만 꽉차게 할수있는방법없나요? 정말 어이없는질문일수도있지만 ㅠㅠ 부탁좀드릴게요!

질문을 종료한 이유: 제가 linearLayout 에서 구현했었는데 weight값을 안줬어서 그렇게된거였네요.......ㅎ
JesusLovesYou (2,700 포인트) 님이 2016년 3월 16일 질문
JesusLovesYou님이 2016년 3월 16일 closed
...