我嘗試創建一個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工作 –