我尝试创建一个Navigation Drawer
。我想在Navigation Drawer
的标题中使用我的图片。导航抽屉标题图片
当我使用我的jpg图像并打开Navigation Drawer
时,它打开得非常慢并且工作不正常。我也希望我的图像应该像在Gmail应用程序中一样显示为圆形。我已将我的jpeg图像放在500kb大小的drawable
文件夹中。
可以做些什么来解决这个问题?
header.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="190dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/headerImage"
android:scaleType="centerCrop"
android:src="@drawable/avina"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/headerImage"
android:id="@+id/headertext"
android:text="Avinash"
android:textSize="20sp"/>
</RelativeLayout>
这对我来说..thankyou工作 –