【问题标题】:MigLayout for design android Forms用于设计 android Forms 的 MigLayout
【发布时间】:2014-01-14 03:56:19
【问题描述】:

我正在做一个项目。我的导师告诉我使用MigLayout 在android 中设计表单。我发现很难找到合适的例子,而在使用 Eclipse 进行开发时,它显示的错误是 android perfix is required to use the attributes

请帮我举一些例子.. 我从源站点 mig4android 粘贴的代码。

 <com.saynomoo.mig4android.MigLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          layout_constraints="wrap 4, debug 1"
          column_constraints="[]15[75px]25[min]25[]"
          row_constraints="[]15"
    >
 <TextView android:text="label1" component_constraints="skip"/>
 <TextView android:text="label2" />
 <TextView android:text="label3" component_constraints="wrap"/>
 <TextView android:text="label4" />
 <TextView android:text="label5" component_constraints="wmin 30"/>
 <TextView android:text="label6" component_constraints="wmin 30"/>
 <TextView android:text="label7" component_constraints="wmin 30"/>

 </com.saynomoo.mig4android.MigLayout>

component_constraints 给出了错误

【问题讨论】:

    标签: android android-layout miglayout


    【解决方案1】:

    此错误意味着您忘记在 xml 文件中的任何属性之前添加 android 字词。

    例如-

    id="@+id/my_location" 
    

    你需要在id之前写android,如下所示。

    android:id="@+id/my_location"
    

    你的代码很完美。 但 component_constraints 中的“跳过”似乎被忽略了。我不得不手动将占位符添加到布局中以“填充”空白点。我尝试了“跳过 1”,但也没有任何影响。

    有关更多信息,请参阅以下链接。

    Skip as a constraint is not working

    【讨论】:

    • 在 miglayout 中有不包含 android 前缀的属性。这就是为什么我会遇到这个问题,如果我得到一个例子,那么我将非常感激。
    猜你喜欢
    • 2020-12-14
    • 1970-01-01
    • 2014-01-13
    • 1970-01-01
    • 2011-05-04
    • 2019-01-14
    • 1970-01-01
    • 1970-01-01
    • 2018-04-12
    相关资源
    最近更新 更多