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...
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 !
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
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.
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
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.
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.
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.
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.
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)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.