android-layout-weight

TableLayout weight sum issues

◇◆丶佛笑我妖孽 提交于 2019-12-04 19:12:52
问题 I'm trying to implement a 40/60 percent split in my TableLayout but I'm having no luck. When testing the code on my Android Device the left TextView still takes up what looks like 60%, instead of 40%. Any help would be great: <TableLayout android:id="@+id/agentStatusTable" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="center|top" android:visibility="visible" android:background="@drawable/curvedbg" android:layout_marginLeft="10sp" android

Nested weights are bad for performance in my XML code [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-04 02:01:33
问题 This question already has answers here : Why are nested weights bad for performance? Alternatives? (6 answers) Closed last year . I want to display an organized grid. So I use LinearLayout and Layout Weight option, every thing works perfectly, but I don't understand how to avoid this warning in the Button A and the Button C: Nested weights are bad for performance And this is my XML code : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res

why is my layout_weight not working?

情到浓时终转凉″ 提交于 2019-12-02 17:48:57
问题 I have this xml file.I can't understand why my second linearlayout which contains editText and callButton isn't looking right. It looks like this (the line with the part picture of phone) : I have the layout_weights set to 1 in each of these views, editText and callButton, so the phone image should take up half the screen, right? Here's my code. I would like both views to take up the same width - and the editText shouldn't stretch when text is entered, as is currently happening. Thanks for

Putting a background on the linear layout and takes almost 3/4 of the screen

随声附和 提交于 2019-12-02 13:40:17
问题 I have tried all kinds of help from other posts (setting widths to 0dp etc.) but nothing seems to work. I have 2 layouts and the first one still seems to dominate. If I put background colors on the textviews, they are behaving themselves and end correctly. However put a background on the linear layout and it is almost 3/4 of the screen!? <?xml version="1.0" encoding="utf-8"?> <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:id="@

Putting a background on the linear layout and takes almost 3/4 of the screen

ぐ巨炮叔叔 提交于 2019-12-02 07:17:30
I have tried all kinds of help from other posts (setting widths to 0dp etc.) but nothing seems to work. I have 2 layouts and the first one still seems to dominate. If I put background colors on the textviews, they are behaving themselves and end correctly. However put a background on the linear layout and it is almost 3/4 of the screen!? <?xml version="1.0" encoding="utf-8"?> <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:id="@+id/rowkRow" android:background="@color/RowBkgColor" android:gravity="center_vertical" android:minHeight

In a Tabbed Activity with ViewPager, the ListView appears cut from the bottom

元气小坏坏 提交于 2019-12-01 20:52:26
问题 I have a Tabbed Activity with three ListView Fragments but the ListView appears cut from the buttom. You never see the last element. I tried everything but I'm not able to solve it. This is the Tabbed Activity: public class TabbedActivity extends AppCompatActivity { private SectionsPagerAdapter mSectionsPagerAdapter; private ViewPager mViewPager; private String query_id; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

In a Tabbed Activity with ViewPager, the ListView appears cut from the bottom

旧时模样 提交于 2019-12-01 20:08:54
I have a Tabbed Activity with three ListView Fragments but the ListView appears cut from the buttom. You never see the last element. I tried everything but I'm not able to solve it. This is the Tabbed Activity: public class TabbedActivity extends AppCompatActivity { private SectionsPagerAdapter mSectionsPagerAdapter; private ViewPager mViewPager; private String query_id; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tabbed); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);

Nested weights are bad for performance in my XML code [duplicate]

喜夏-厌秋 提交于 2019-12-01 12:43:06
This question already has an answer here: Why are nested weights bad for performance? Alternatives? 6 answers I want to display an organized grid. So I use LinearLayout and Layout Weight option, every thing works perfectly, but I don't understand how to avoid this warning in the Button A and the Button C: Nested weights are bad for performance And this is my XML code : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >

How to divide layout to 3 parts?

混江龙づ霸主 提交于 2019-12-01 06:37:24
I'm trying to divide my layout to 3 equal rows, trying to use LinearLayout and weights, but it doesn't work, it doesn't make any change: <LinearLayout android:id="@+id/rightLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignBottom="@+id/picture" android:layout_alignParentRight="true" android:layout_alignTop="@+id/picture" android:layout_toRightOf="@+id/aligner" android:orientation="vertical" android:weightSum="3" > <LinearLayout android:id="@+id/lay1" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android

How to divide layout to 3 parts?

一笑奈何 提交于 2019-12-01 05:31:02
问题 I'm trying to divide my layout to 3 equal rows, trying to use LinearLayout and weights, but it doesn't work, it doesn't make any change: <LinearLayout android:id="@+id/rightLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignBottom="@+id/picture" android:layout_alignParentRight="true" android:layout_alignTop="@+id/picture" android:layout_toRightOf="@+id/aligner" android:orientation="vertical" android:weightSum="3" > <LinearLayout android:id="@+id