当前位置: 代码迷 >> Android >> 有一小片断xml代码是不是直接加入主xml文件中可运行
  详细解决方案

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

热度:32   发布时间:2016-04-28 07:16:04.0
有一小片段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里面就差不多了
  相关解决方案