Wish float input for Designer's width, height...

Cableguy

Expert
Licensed User
Longtime User
I don't get it... Width and height are always integers... You cannot set half a pixel...
There's not a single screen with 320.75 pixels, nor can you set a line with to be 0.75 pixels width...
 

peacemaker

Expert
Licensed User
Longtime User
But 1dip setting - not visible on high-density screens sometimes. 2dip - is always visible.
But if to set by the Designer code: .Height = 1.5dip - and magic ! The thinnest line is now visible !
 

Cableguy

Expert
Licensed User
Longtime User
You need to understand HOW the designer works, why there's variants, screen densities and most of all, learn to use the scripting feature...
Take a good read at Klau's beginners guide booklet! There's a whole chapter dedicated to these things
 

peacemaker

Expert
Licensed User
Longtime User
I just need 1 pixel line at any phone in my app.
But it's not possible now.
No exact idea why. And i just found such a trick with height=1.5dip.
But if i'm wrong making 1dip panel, or it's IDE bug - better, if it would be fixed.
 

Cableguy

Expert
Licensed User
Longtime User
There are a few dozens different screen sizes in the smartphone world alone, not counting the tablets and other android devices. If all you want us to create an app that will run in your phone (and your phone only) connect it to your pc using a usb cable, and hit F2 in the designer. You will see your layout and how it looks like IN YOUR PHONE.
You can also hit the "match connected device layout" so that the designer layout replicates your phone screen size and density
 

Cableguy

Expert
Licensed User
Longtime User
I just need 1 pixel line at any phone in my app.
But it's not possible now.
Yes it is, RTFM!
No exact idea why. And i just found such a trick with height=1.5dip.
It's not a trick, DIP is a relative unit, while pixel is an absolute one! RTFM!
But if i'm wrong making 1dip panel, or it's IDE bug - better, if it would be fixed.
It is NOT A BUG! RTFM!

RTFM.... Try googling it... It will be very instructive
 

klaus

Expert
Licensed User
Longtime User
Are you using AutoScaleAll?
What is your layout variant in the Designer?
What is the screen size and density of the device where 1 dip doesn't work?
If you really want a 1 pixel height you must set it explicitly in the DesignerScripts.
Can you post a small project showing the problem.
 

peacemaker

Expert
Licensed User
Longtime User
Yes, AutoScaleAll is used.
Designer script .height= 1dip - does not help.
Designer script .height= 1.5dip - does help. I'll do it manually, all other views should be autoscaled, yes.
 

klaus

Expert
Licensed User
Longtime User
Sorry, why don't you answer all my questions?
What is your layout variant in the Designer?
What is the screen size and density of the device where 1 dip doesn't work?

Setting Panel.Height = 1 in the DesignerScript works and gives you a 1 pixel height.
 

peacemaker

Expert
Licensed User
Longtime User
Sorry, why don't you answer all my questions?
What is your layout variant in the Designer?
What is the screen size and density of the device where 1 dip doesn't work?

Setting Panel.Height = 1 in the DesignerScript works and gives you a 1 pixel height.

I'm sorry, indeed, the first question is very important, i think now: used single layout 320 x 480 with Designer script ('All variants script) on Full HD 5.5'' device.
And no - nor "Panel.Height = 1", neither "Panel.Height = 1dip", neither "Panel.Height = 1.5" - do not give result.

Just "Panel.Height = 1.5dip" helps.
 

klaus

Expert
Licensed User
Longtime User
As already suggested, you should post a small project showing the problem.
In my test project Panel.Height = 1 works!

First line Panel1.Height = 1 in the DesignerScript (Panel height 1 pixel on my device)
Second line Height = 1 in the Designer (Panel height 1dip = 4 pixels on my device)
Third line Height = 2 in the Designer ((Panel height 2dip = 8 pixels on my device)

upload_2017-8-29_14-55-45.png
 

Attachments

  • TestPanelHeight.zip
    7.4 KB · Views: 181
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Thanks for the sample !
At my device:
If without AutoScaleAll: 1, 3, 5 pixels height.
With AutoScaleAll: 1, 4, 6.
 
Top