I have two side by side TextViews in LinearLayout, but second TextView taking more space than first one and i want both to take equal width that's why i have used layout_weight="1"
but did not solve my issue, check below:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="20dp"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/as_individual"
android:gravity="center_vertical"
android:drawablePadding="5dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="As" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="@drawable/for_company"
android:gravity="center_vertical"
android:textColor="#ffffff"
android:drawablePadding="5dp"
android:text="For Company"/>
</LinearLayout>
No comments:
Post a Comment