Page 1 of 2

Buttons with unwanted box

Posted: Tue Jan 22, 2013 9:32 pm
by cusingerBUSCw5N
I have weird problem going on with my buttons on Android.

My buttons are basic text with a background and a dropshadow. They are fine in Windows and on IOS. But when I put them on an Android - IF the button text isn't wide....it creates a box with a different color - sometimes on one side - sometimes on both.

It happens when it goes through code setting the button width such as:

set the width of button "xyz" to tstackwidth*0.88.

I have remade the buttons - no difference. If I add more text to the button label, it goes away. If I reduce the text in the button label, the boxes get bigger.

Very annoying. Is there any way to get rid of the boxes? Thanks

Image

Re: Buttons with unwanted box

Posted: Tue Jan 22, 2013 10:08 pm
by Simon
I'm pretty sure you have set that red color in one of the stacks properties.
You'll have to use the inspector and look around, it could be in the stack/card/group/button (others?).

Simon

Re: Buttons with unwanted box

Posted: Tue Jan 22, 2013 10:11 pm
by cusingerBUSCw5N
but I created a new button - new name...same thing happened.

Re: Buttons with unwanted box

Posted: Tue Jan 22, 2013 10:14 pm
by cusingerBUSCw5N
I just set the background color to pink

set the backgroundcolor of button "local_help_button2" to "pink"

and it now has two lovely light purple boxes in a pink button (on Android only).

Re: Buttons with unwanted box

Posted: Tue Jan 22, 2013 10:29 pm
by Simon
but I created a new button - new name...same thing happened.
As I said it could be anywhere... not just the button. Could be the background of the group the button is in or it's card or.. or.. or

As you are resizing the objects, gaps may form that allow you to see behind the object.

Simon

Re: Buttons with unwanted box

Posted: Tue Jan 22, 2013 11:23 pm
by cusingerBUSCw5N
OK. I don't know why but this is fixing my problem:

Somehow it is the location of the button that triggers this problem. If I move the button a little bit down, it doesn't create the extra boxes. So, I changed the code from

set the top of button "local_help_button2" to the bottom of button "contacts" +tverticalspace

to

set the top of button "local_help_button2" to the bottom of button "contacts" +tverticalspace*1.1

and voila...no more boxes.

(I don't think it was a parameter that I set because there's nothing except backgroundcolor - which I tried changing without any help on the unwanted boxes. I don't think it's hidden fields because I made all the hidden fields visible to make sure they weren't the cause... My explanation above makes no logical sense...but for some reason corrected the problem. It also explains why creating a new button and putting it in the same place didn't work. In the past, I have had some unwanted boxes in the top right corner of Androids as well - so I think there are certain places that trigger this weird issue.)

Re: Buttons with unwanted box

Posted: Wed Jan 23, 2013 12:46 am
by jacque
What version of Android? I had a similar problem in 2.2 but it went away in 2.3. It didn't happen with buttons, but the rectangles were similar.

Re: Buttons with unwanted box

Posted: Sun Jan 27, 2013 3:22 am
by cusingerBUSCw5N
These stupid boxes of unwanted color are going to drive me nuts.

I just added some fields with background color - and on the Android, there are boxes of unwanted color wherever there is an empty space - - i.e., if the text is:

John Brown went
to the cafe to have hot chocolate and cookies.

the box will appear next to went - because there is a large space.

And if I make the field wider than the text, the boxes will appear as well.

Plus...if there is any movement (I was experimenting with moving fields) - the boxes are all over the place when it's moving.

It seems they don't appear if the background of the box is white or gray.

I am using Android 4.1.1

Re: Buttons with unwanted box

Posted: Sun Jan 27, 2013 4:04 am
by Simon
Any chance you can post a small stack the displays the problem?

Simon

Re: Buttons with unwanted box

Posted: Sun Jan 27, 2013 4:31 am
by jacque
Are you using acceleratedRendering? If so, try setting the compositorType to "software". That was the problem with my app in Android 2.2. It's still a bug, but that may be a workaround for now.

Re: Buttons with unwanted box

Posted: Mon Jan 28, 2013 7:24 am
by cusingerBUSCw5N
Aha! I created a small stack and didn't have the problem. So I ripped apart my app and found the culprit:

Code: Select all

  if the platform is "iphone" then
   set the compositorType of this stack to "opengl"
   else
        set the compositorType of this stack to "software"
  end if
(put in my stack script)

I added this when I was trying to get the finger scrolling to work better on the mobile devices. If I remove it, the weird boxes go away. So do I have to choose between bad scrolling and weird boxes? I was specifically working on scrolling for the Android - and was told I needed to check the box Layer Mode to scrolling and add this code.
:?

Re: Buttons with unwanted box

Posted: Mon Jan 28, 2013 7:34 am
by cusingerBUSCw5N
Here's a zipped stack showing the exact problem - with the bad code in it. You can see when you open it up (on an Android) the field background color is all messed up. Then when you click the button and see things moving, it's a real mess - because the background isn't white. When the background is white, then only the boxes are flashing diffferent colors.

Re: Buttons with unwanted box

Posted: Mon Jan 28, 2013 7:20 pm
by jacque
I didn't actually install and look at your test stack, but I think you can remove the handler without any problem. If you wrote the original code back when acceleratedRendering was first introduced, you needed to set all its properties in script. But with the latest version of LiveCode default properties are set automatically, and you only need to set them if the defaults don't work. Since removing the handler works okay, that means the defaults are also okay. As long as acceleratedRendering is true, you should still get the benefits of smooth scrolling.

Re: Buttons with unwanted box

Posted: Tue Jan 29, 2013 2:35 am
by cusingerBUSCw5N
Thanks. I didn't even know about acceleratedrendering....

So I have added this to my stack script:

set the acceleratedRendering of this stack to true
I am hoping to have wonderful scrolling AND color! :D

Re: Buttons with unwanted box

Posted: Tue Jan 29, 2013 3:21 am
by cusingerBUSCw5N
Nope....put my happy face on too soon.

Code: Select all

set the acceleratedRendering of this stack to true
Causes my app not to open in Android. Goes through the entire open script - but then stops - and doesn't open anything. Take out the code and it works.

So...we're back to choosing between scrolling and colors?