0

Hopefully this is something simple and stupid. I am editing an existing Android app for an embedded device that communicates with Bluetooth. The manufacturer of the development kit provides the Android code so that you can edit it how you want. The device (Silabs Thunderboard Sense 2) just transfers numeric information (sensor data) from the device to the phone.

I have been able to edit the actual code to change labels and values to what I want, but now I want to rearrange/add/eliminate some buttons in the screen layout. The app generates these buttons when downloaded to the phone, but I'm unable to see them when I open the .xml files in "design view" in Android Studio. At first I thought the buttons weren't there at all, but then I noticed that there is a blue line down the left side of the sample screen. When I click on it, I get the attributes etc., but no matter what I try, I can't seem to get the button to show. I have tried pulling it, double-clicking it, right-clicking it, changing attributes...nothing works. I'm thinking that it's a setting that needs to be tweaked, but I'm afraid to just go changing everything and making it worse. Here is what it looks like: the red circle indicates where the mysterious blue line appears.

It's like the image is scrunched to the left with no width. It should be a square image button with a small icon, a label and some live data. Any ideas?

Don

1 Answers1

1

try setting the FrameLayout width policy to match_parent.

EDIT

Also check your parent LinearLayout width and height policy is `match_parent'.

Community
  • 1
  • 1
Karan Dhillon
  • 1,186
  • 1
  • 6
  • 14