首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

有一小片断xml代码是不是直接加入主xml文件中可运行

2013-11-29 
有一小片段xml代码是不是直接加入主xml文件中可运行LinearLayoutxmlns:androidhttp://schemas.android.

有一小片段xml代码是不是直接加入主xml文件中可运行

<LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical">
  <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:padding="5dp">
    <Button
      android:text="@string/cancel_button_text"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1"/>
    <Button
      android:text="@string/ok_button_text"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1"/>
  </LinearLayout>
  <ListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
</LinearLayout>

加入到主xml中无法运行啊,需要做那些事情呢?如果可以怎么加入呢?
[解决办法]
main.xml 里面有一部分是关于命名空间的地方 copy到你这个 xml里面就差不多了

热点排行