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

DatePickerDialog 질문입니다...

0 추천

커스텀 한것도 아니고...아래와 같이 생성해서 보여주는데

에뮬로 API 22돌렸을 땐 달력이 포함되서 나오고

API 19로 돌렸을 때는 다이얼로그처럼 나옵니다.(전혀 형태가 다르게 나온다는 것이 의아..)

 

하나로 일치시켜서 보여주고 싶은데...뭘 건드려야 하나요??

 

GregorianCalendar calendar = new GregorianCalendar();

        year = calendar.get(Calendar.YEAR);
        month = calendar.get(Calendar.MONTH);
        day= calendar.get(Calendar.DAY_OF_MONTH);

        DatePickerDialog datePicker = new DatePickerDialog(this, dateSetListener, year, month, day);
        datePicker.show();

 

private DatePickerDialog.OnDateSetListener dateSetListener = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
            String msg = String.format("%d / %d / %d", year,monthOfYear+1, dayOfMonth);
            Toast.makeText(DateTestActivity.this, msg, Toast.LENGTH_SHORT).show();

        }
    };

 

 

참고로 어플 테마는 아래와 같습니다.

<resources>
    <style name="AppTheme" parent="AppTheme.Base" >
    <!-- Base application theme.
         Defining this lets values-v21/styles.xml reuse it with changes. -->
    </style>
    <!--<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">-->
    <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- colorPrimary is used, for instance, for the default ActionBar
             (but not Toolbar) background.
              We specify the same color for the toolbar background in
              toolbar.xml.. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/logo_green</item>
</style>
</resources>

 

치솟음 (3,710 포인트) 님이 2015년 10월 30일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...