안녕하세요 앱 개발 한달차... 입니다!!
메뉴바를 만들어서 체크박스를 추가했는데 메뉴 클릭시 메뉴바가 열리는 과정에서 렉이걸립니다...
도대체 어떻게어디를 손봐야 될지...
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개 이상부터 렉이 걸리네요ㅜㅜ