• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Layout XML not Working as Expected

ac4android

Well-Known Member
Nov 3, 2015
198
29
Hi, I am using Andoid Studio 1.5.5 and building a gradle based on Nexus 4 APD21, I am encoutering the following problems with XML layout:

I am trying to do a GridLayout with 2 columns and any number of rows
1st row spans 2 columns and has a welcome message for my TeaForTwo
2nd row 1st column has a text lable "Temperature:"
2nd row 2nd column has a togglebutton for "cold" or "ice" tea.
3rd row, 4th row and 5th row have checkboxes for tea wit mik / sugar / lemon

I've tried numerous variations with the XML, but I can't get all the views to be visible together e.g.
for textview of welcome message, with or without android:layout_columnSpan="2" ( i.e. let android decide), or even android:gravity="fill_horizontal"
The latest variation has no welcome message but has working toggle button.

Can anyone see what I might have missed? It's frustrating because it takes minutes to rebuild and load the AVD each time I change the XML

Capture.JPG
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones