Вопрос

I am on a project. My instructor has told me to use MigLayout to design the forms in android. I am finding it difficult to find proper examples and while Using Eclipse for development its showing errors that android perfix is required to use the attributes.

please help me with some examples.. code that i pasted from the source site,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>

The component_constraints gave the error

Это было полезно?

Решение

This error means you forget to add android word before any attribute in xml file.

For example-

id="@+id/my_location" 

You need to write android before id like below.

android:id="@+id/my_location"

Your code is perfect. But "skip" in component_constraints appears to be ignored. I had to manually add place holder to the layout to "fill in" empty spots. I tried "skip 1" and that also had no impact.

For more information see following link.

Skip as a constraint is not working

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top