Android 台灣中文網

標題: 看不懂linearlayout 的程式碼 [打印本頁]

作者: 隨意上進    時間: 2012-4-27 19:23
標題: 看不懂linearlayout 的程式碼
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

這其中第一行
xmlns:android="http://schemas.android.com/apk/res/android"
是有什麼功能阿??



作者: ploglin    時間: 2012-4-30 09:16
xmlns:android 這是一個XML命名空間,告訴Android開發工具你準備使用Android命名空間裡的一些通用屬性。
作者: 隨意上進    時間: 2012-5-1 11:13
ploglin 發表於 2012-4-30 09:16
xmlns:android 這是一個XML命名空間,告訴Android開發工具你準備使用Android命名空間裡的一些通用屬性。 ...

那後面那一串指的是什麼呢?
作者: ploglin    時間: 2012-5-2 09:14
namespace的定義都會在指定的網址
就像html會指定

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
複製代碼
是一樣的意思




歡迎光臨 Android 台灣中文網 (https://apk.tw/) Powered by Discuz! X3.1