1
Hi new to Xamarin android。有這個問題:如何在工具欄內添加Logo圖像
1)如何在工具欄中添加圖片Logo?
什麼是W X H的圖片標誌大小間?
這裏的工具欄
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:layout_width="match_parent" />
感謝
----更新:解決
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:layout_width="match_parent" />
<ImageView
android:id="@+id/toolbarimage"
android:layout_marginTop="12dp"
android:layout_marginBottom="6dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/Logo" />
</android.support.v7.widget.Toolbar>
看到您的解決方案真的很開心。請幫助我,因爲我在安裝V7 appCompat時遇到問題。在這裏我的步驟,我右鍵單擊該項目下的組件,以獲得V7 AppCompat。起初所有與Xamarin.Android.Support.compat和其他Xamarin.Android.Support DLL導入組件和參考文件夾中的DLL。過了一段時間,爲什麼在所有DLL中都附帶了一個黃色三角警告標誌,並以參考文件夾中的Xamarin.Android.Support開頭?這是什麼意思?當我右鍵單擊參考文件夾並選擇Nuget Manager時,它顯示V7 AppCompat已安裝。發生什麼事? – MilkBottle
某些依賴關係可能未完全安裝。請嘗試卸載所有nuget軟件包並再次通過nuget安裝'xamarin.android.support.v7.appcompat'。 –
首先通過組件獲取支持v7 Appcompat的支持。當點擊參考文件夾時,它將顯示v7 Appcompat:1)已安裝25.1.1 - 卸載btn
2.版本25.1.0 - 更新btn
我需要點擊更新btn才能獲得25.1。0如果沒有,我得到黃色三角警告標誌。 25.1.1有問題嗎?必須使用版本25.1.0?感謝 – MilkBottle