【发布时间】:2014-04-20 12:30:42
【问题描述】:
我正在使用导航抽屉分页器滑动标签条。它在 Slider 中显示菜单。现在,我想在 Slider 中添加个人资料照片和用户名。我尝试添加 LinearLayout,但它给出了 ClassCastException。
来源:https://github.com/Balaji-K13/Navigation-drawer-page-sliding-tab-strip
activity.xml:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/lightish"
android:choiceMode="singleChoice"
android:divider="@color/blue"
android:dividerHeight="1dp" />
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
我想您需要实现自己的自定义适配器才能获得所需的东西。这里举个例子tutecentral.com/android-custom-navigation-drawer
-
查看下面的链接,这对我帮助很大:ux.stackexchange.com/questions/44776/…
标签: android navigation-drawer pagerslidingtabstrip