android - TextView and Checkbox inside LinearLayout, but Checkbox disappears -


i have textview , checkbox inside linearlayout. checkbox must appear right of textview. in eclipse view, checkbox appear, when launch app in device checkbox disappears.

this eclipse view (checkbox star):

enter image description here

this part of xml file:

    <relativelayout      android:id="@+id/infoinstalacion_fragment1_relative_imagen_poli"     android:layout_width="match_parent"     android:layout_height="wrap_content"      android:layout_weight="100">  <imageview     android:id="@+id/infoinstalacion_fragment1_imgfoto"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:scaletype="fitxy"     android:src="@drawable/pld_alza" />      <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignbottom="@+id/infoinstalacion_fragment1_imgfoto"     android:background="@color/transparent">  <textview     android:id="@+id/infoinstalacion_fragment1_nombre_encima_de_imagen"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_marginleft="5dp"     android:paddingright="35dp"     android:textsize="20dp"     android:textstyle="bold"     android:textallcaps="true"     android:textcolor="@color/white"     android:lines="2"     android:text="esto es un polideportivo"      android:gravity="center_vertical"/>              <checkbox     android:id="@+id/infoinstalacion_fragment1_checkbox_favorito"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:focusable="true"     android:button="@drawable/checkbox_favorito"/>  </linearlayout> 

does know problem is?

thank.

try assigning weight linearlayout , it's children this:

<linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:weightsum="1" android:orientation="horizontal" android:layout_alignbottom="@+id/infoinstalacion_fragment1_imgfoto" android:background="@color/transparent">  <textview android:id="@+id/infoinstalacion_fragment1_nombre_encima_de_imagen" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="5dp" android:paddingright="35dp" android:textsize="20dp" android:textstyle="bold" android:textallcaps="true" android:textcolor="@color/white" android:lines="2" android:layout_weight="0.70" android:text="esto es un polideportivo"  android:gravity="center_vertical"/>          <checkbox android:id="@+id/infoinstalacion_fragment1_checkbox_favorito" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="true" android:layout_weight="0.30" android:button="@drawable/checkbox_favorito"/> 

hope helps !


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -