java - Column_layout does not work in android tablelayout -
mistake in tablelayout in android. issue want move button 1 column in second row using property column_layout in 2 tablerow. have found solution. please,check answer.
android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".tablelayoutactivity" android:orientation="vertical" <tablerow> <button android:id="@+id/firstbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/myfirstbtn"/> <button android:id="@+id/thirdbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/mythirdbtn"/> <button android:id="@+id/fourthbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/myfourthbtn"/> </tablerow> <tablerow> <button android:id="@+id/secbutton" android:layout_column="1" android:text="@string/mysecbtn"/> </tablerow>
i have removed weight property , removed android:layout_width="0dp". have insert android:layout_width="wrap_content" instead. problem solved.
<tablelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".tablelayoutactivity" android:orientation="vertical" > <tablerow> <button android:id="@+id/firstbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/myfirstbtn"/> <button android:id="@+id/thirdbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/mythirdbtn"/> <button android:id="@+id/fourthbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/myfourthbtn"/> </tablerow> <tablerow> <button android:id="@+id/secbutton" android:layout_column="1" android:text="@string/mysecbtn"/> </tablerow> </tablelayout>
Comments
Post a Comment