The following fills the entire screen:
<View height="Ti.UI.FILL" width="Ti.UI.FILL">...</View>
The fill property is describe here: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-FILL
However you can also do the same thing using:
<View height="100%" width="100%">...</View>
Therefore my question is, what's the difference?
Official guide says:
"The Ti.UI.FILL behavior represents growing a view to fill its parent's dimensions. Note that the FILL behavior doesn't take into consideration other sibling elements in the parent."
http://docs.appcelerator.com/platform/latest/#!/guide/Layouts,_Positioning,_and_the_View_Hierarchy
For sure Ti.UI.FILL is a Titanium constant you can use everywhere as is, while 100% is a string. I always prefer the first one.
There could be a difference when we put two elements in the same container giving to one FILL and the other one a fixed size, or giving 100% to the first one and a fixed size to the other one, but usually when I use a view which should fill a space it's the only one in the container so I've never noticed any difference.
Related
This should be a simple fix but I can’t figure it out. Please excuse my lack of posting my whole code.
Here is the issue. I am using the following
`
<v-card>
<v-img :src=“{{person.png}}”</v-img>
<v-card>
`
I have an array of users with profile images. Some of these images are different sizes ( some may be 400w other maybe 250w ). My issue is that because these images are different sizes, that they actually end up making my cards ( which are uniform in size ), different widths and height. This makes the cards ugly of course, and I need help on how to fix this.
Now, I had a friend build a react project, and I providing him with pictures, but the sizes were off. I fixed this by importing all images into Figma and making them all the same height and width, which, worked. However, for this project, this method isn’t working for me and I need a way to auto size these images so that my cards stay uniform.
I do not want to use the v-avatar feature, so please refrain from asking me, because these aren’t really “avatars”.
One “solution” I found was to use “contain” but I can’t find any information on contain in the documentation and I’m not sure if that would even work.
Unfortunately in some edge cases you cannot depend only on the components provided by a framework and you need to improvise. This issue sounds purely like a CSS one. Instead of using vuetify component you could try to create own component and just apply the avatar image as element's background-image inline property. Then you could use background-size: cover in order to preserve correct ratio of uploaded images.
I never found a 1 size fits all fix for this, but this is what I did to make it work out.
1. I imported all images to figma
2. I edited the images to all be the same size, then used the crop tool to "fit" them to the new "canvas" size
3. Within my v-img , I added "contain", which insured that the picture didn't get cut off or cropped when placing inside of a card.
Thanks for the help all.
Good morning!
I'm currently trying to create a view similar to this mockup.
I have put down 3 different screen sizes so you can see the issue.
I have a header background image (grey box) with an angled bottom. On the right I want to display an image, which obviously needs to be positioned.
Positioning it horizontally is no issue but how can I position the image vertically? I have it positioned fixed for one screen size but obviously need to make it flexible.
Any ideas? Help would be much appreciated!
David
You can definitely use measure as #rajesh pointed out, or you can use Dimensions. As far as getting the layout consistent across devices, using position absolute and measuring the device height should allow you to get consistency across these devices.
Check out this example I set up, it should be a good starting point at least.
https://rnplay.org/apps/pSzCKg
Now I could be wrong about this but after testing it all day, I have discovered...
When adding a widget and setting the z-index, the value "0" seems to be the magic depth.
If a widget's Z is at 0, it will be drawn on top of everything that's not at 0, Z wise.
It doesn't matter if a widget has a z-index of 99, -999, 10, -2 or what ever... It will not appear on top of a widget who's z-index is set to 0.
It gets more strange though...
Any index less than -2 or greater than 2 seems to create an "index out of range" error. Funny thing is...when I was working with a background and sprite widget, the background's Z was set to 999 and no errors. When I added another sprite widget, that's when the -2 to 2 z-index limitation appeared.
Yeah I know...sounds whacked!
My question is, am I right about "0" being the magic Z value?
If so, creating a simple 23D effect like making a sprite move being a big rock will take some unwanted code.
Since you can only set Z when adding,a widget, one must remove and immediately add back, with the new Z value...a widget.
You'll have to do this with the moving sprite and the overlapping object in question. Hell, I already have that code practically written but I want to find out from Kivy pros, is there a way to set z-index without removing and adding a widget.
If not, I'll have to settle for the painful way.
My version of Kivy is 1.9.0
What do you mean by z-order? Drawing order is determined entirely by order of widgets being added to the parent, and the index argument to add_widget is just a list index at which the widget will be inserted. The correct way to change drawing order amongs widgets is to remove and add them (actually you can mess with the canvases manually but this is the same thing just lower level, and not a better idea).
I found a working solution using basic logic based on the fact widgets have to be removed and added again in order to control depth/draw order.
I knew the Main Character widget had to be removed along with the object in question...so I created a Main Character Parent widget, which defines and control the Main Character, apart from its Graphic widget.
My test involves the Main Character walking in front of a large rock, then behind it...creating a 23D effect.
I simply used the "y-" theory along with widget attach and detach code to create the desired effect.
The only thing that caught me off guard was the fact my Graphic widget for my Actor was loading textures. That was a big no no because the fps died.
Simple fix, moved the texture loading to the Main Character Parent widget and the loading is done once for all-time.
PS, if anyone knows how to hide the scrollbars and wish to share that knowledge, it'll be much appreciated. I haven't looked for an API solution for it yet but I will soon.
Right now I'm just trying to make sure I can do the basic operations necessary for creating a commercial 23D game (handhelds).
I'm a graphic artist and web developer so coming up with lovely visuals won't be an issue. I'm more concerned with what'll be "under the hood" so to say. Hopefully enough, lol.
I've been looking all over the place to find the solution to this but haven't had success. I have a Sketchflow project and I want to scale every Screen to the browser resolution on running, as in scaling every element of the current Layout to fit the screen.
Do you want the objects themselves to get bigger to fill the screen or to spread out? For objects to get bigger you can wrap the whole thing in a ViewBox.
We have created an application in [ADF] in Oracle JDeveloper 11g Release1.
We are facing a resizing issue.
When we re-size our application.. most of the components are getting cut. They are not resizing as per the screen resolution.
Kindly provide suitable inputs.
it is only working fine on 1364 x 768. :( but on resolutions lesser than these, the components are not flexible as per the screen resolution.
kindly send us a pointer in this case.
Well, it's little tricky to get the right resize behavior. In ADF every component has two aspects:
If it can be resized by it's parent: So if you even put a component which can be resized still you wont be able to if the parent is not resizable for example you should not expect it happening for any child component if the parent is a panelGroupLayout of type vertical
If it is resizable: Many components are not resizable at all in adf so no matter how you use them they wont.
Have a look at http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/layoutBasics.jspx;jsessionid=pGxPT2BY4GfrvvWWpTvx3QNTn1F3GTQxFlVwBYSF1WG3wLwBS2vp!-1053881112?_afrLoop=89920899359956&_afrWindowMode=0&Adf-Window-Id=w0
For an Image you can also try using HTML tags in ADF: