See here what i meanAndroid Di chuyển bóng On Navigation Drawer
Hi, Tôi đang sử dụng chứng khoán Ngăn điều hướng v4 và tôi hỏi làm thế nào có thể xóa bóng nền khi chuyển hướng ngăn kéo đang mở.
đây là mã của tôi của NavigationDrawerFragment.java
public void setUp(int fragmentId, DrawerLayout drawerLayout) {
mFragmentContainerView = getActivity().findViewById(fragmentId);
mDrawerLayout = drawerLayout;
// set a custom shadow that overlays the main content when the drawer opens
mDrawerLayout.setDrawerShadow(R.drawable.trasparent, GravityCompat.START);
// set up the drawer's list view with items and click listener
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
Và đây là MainActivity.xml
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Main layout -->
<FrameLayout
android:id="@+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/ImageView3_Left"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:background="#FFFFFFFF"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"/>
</android.support.v4.widget.DrawerLayout>
Bạn vẫn gặp sự cố khi các phiên bản Android mới hơn sử dụng độ cao thay vì Bóng có thể vẽ. Độ cao đó có thể được thiết lập mặc dù: navigationDrawer.setElevation (0f); –