2014-10-01 85 views
0

我完全不熟悉Android開發。我如何使用系統圖標

我想用按鈕/圖片這樣的:

enter image description here

在我的應用程序

。我不想重現它們(創建新的PNG文件等)。 我猜這些資源是在Android的某個地方。

  1. 我該如何使用它們?

  2. 這在Android開發中常見於依賴系統內置圖像嗎?

回答

0

如果您的意思是在哪裏可以找到Android開發的圖標,您可以找到Android圖標here

你會發現有用的信息和鏈接到一個zip圖標與圖標準備不同的設備屏幕。

0

您可以編寫水木清華這樣在你的XML佈局文件:

 <ImageView 
      android:layout_width="20dp" 
      android:layout_height="20dp" 
      android:src="@android:drawable/ic_menu_login" 
      android:id="@+id/my_button"/> 

或者,你可以從這裏下載圖標: https://developer.android.com/design/downloads/index.html

+0

那麼'ic_menu_login'是內置圖標嗎?我在哪裏可以找到這些列表? – Kamil 2014-10-01 11:18:32

0

在用於放置圖像的android資源文件夾中。我們將通過代碼獲取該圖像。

嘗試拍攝transprent圖像。所以這不會有背景。

<ImageView 
     android:id="@+id/logo" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" 
     android:layout_gravity="center" 
     android:contentDescription="@string/logo" 
     android:src="@drawable/odesk_logo" />