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

메뉴바를 만들어서 체크박스를 추가시 걸리는 렉

0 추천

안녕하세요 앱 개발 한달차... 입니다!!

메뉴바를 만들어서 체크박스를 추가했는데 메뉴 클릭시 메뉴바가 열리는 과정에서 렉이걸립니다...

도대체 어떻게어디를 손봐야 될지...

MainActivity.java

toolbar = (Toolbar) findViewById(R.id.toolbar);
        dlDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);

        setSupportActionBar(toolbar);

        dtToggle = new ActionBarDrawerToggle(this, dlDrawer, R.string.app_name, R.string.app_name);
        dlDrawer.setDrawerListener(dtToggle);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

 

activity_main.xml

<RelativeLayout
            android:id="@+id/drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="#ffffff" >

            <TextView
                android:id="@+id/main_drawer_category"
                android:text="카테고리"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#1f96f2"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_marginTop="5dp"
                android:layout_marginLeft="5dp"
                android:textStyle="bold"
                android:textSize="18dp" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="2dp"
                android:id="@+id/main_imageview_line"
                android:background="#FFADADAD"
                android:alpha="0.4"
                android:layout_alignParentRight="true"
                android:layout_marginTop="5dp"
                android:layout_below="@+id/main_drawer_category"
                android:layout_alignLeft="@+id/main_drawer_category"
                android:layout_marginRight="5dp" />

            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="44.5dp"
                android:id="@+id/main_CheckBox_category_total"
                android:layout_alignLeft="@+id/main_imageview_line"
                android:layout_alignRight="@+id/main_imageview_line"
                android:background="@drawable/selector_total"
                android:button="@android:color/transparent"
                android:layout_below="@+id/main_imageview_line"
                android:layout_marginTop="5dp"/>

            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="44.5dp"
                android:id="@+id/main_CheckBox_category_music"
                android:layout_alignLeft="@+id/main_imageview_line"
                android:layout_alignRight="@+id/main_imageview_line"
                android:background="@drawable/selector_music"
                android:button="@android:color/transparent"
                android:layout_below="@+id/main_CheckBox_category_total"
                android:layout_marginTop="5dp"/>

            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="44.5dp"
                android:id="@+id/main_CheckBox_category_health"
                android:layout_alignLeft="@+id/main_imageview_line"
                android:layout_alignRight="@+id/main_imageview_line"
                android:background="@drawable/selector_health"
                android:button="@android:color/transparent"
                android:layout_below="@+id/main_CheckBox_category_music"
                android:layout_marginTop="5dp"/>
            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="44.5dp"
                android:id="@+id/main_CheckBox_category_book"
                android:layout_alignLeft="@+id/main_imageview_line"
                android:layout_alignRight="@+id/main_imageview_line"
                android:background="@drawable/selector_book"
                android:button="@android:color/transparent"
                android:layout_below="@+id/main_CheckBox_category_health"
                android:layout_marginTop="5dp"/>
        </RelativeLayout>
    </android.support.v4.widget.DrawerLayout>


    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="#1f96f2" />


</RelativeLayout>

 

checkbox 2개 이상부터 렉이 걸리네요ㅜㅜ

프로그래밍이란 (120 포인트) 님이 2016년 2월 12일 질문

답변 달기

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