Flex 4 Vslider track, top and bottom margin - flex4

I have a Vslider in Flex 4 that I am skinning with images. The image for the thumb makes it much larger and the track image has some stuff at the top and the bottom that I do not want to be covered by the thumb when it is all the way at the top or bottom. So, how do I create that margin so the range of the thumb on the track is shorter?

You can do this by specifying the thumb height to be larger than it really is in the skin for the vslider.
<!--- The default skin class is VSliderThumbSkin.
#copy spark.components.supportClasses.TrackBase#thumb
#see spark.skins.spark.VSliderThumbSkin -->
<s:Button id="thumb" left="0" right="0" width="11" height="50"
skinClass="your.thumb.skin.class"/>
The skin class has an image that is 25x25. By making this class have a height of 50 it gives the thumb ~12px of padding on both top and bottom of the thumb.

Related

Appcelerator Titanium - don't stretch image to ImageView dimentions

I have an image of size 1024x1024 and I want to have it a background as an ImageView object. I've set the ImageView height and width to be the size of the device and loaded the image - what happens is that the image shows the entire image squeezed to the given dimensions.
What I would like to see is not the entire image - I want it to scale to show it centered, and the parts of the image that don't fit the screen to not show. What my end result should be just setting the height and the width whatever is disposable will be overflowed and hidden.
How can I set an image not to stretch?
What your looking for is a clipped image. This affect is best achieved using a combination of View with clipping turned on and an ImageView.
As an example, we'll use a large image and the code below.
<Alloy>
<Window class="container" backgroundColor="#000">
<View clipMode="Titanium.UI.iOS.CLIP_MODE_ENABLED" width="200">
<ImageView image="/images/Moonset_over_ESO's_Very_Large_Telescope.jpg" height="2336" width="3504"/>
</View>
</Window>
</Alloy>
Note that we have enabled clipping on the parent View, and are using it to define the actual width we want everything rendered on the Screen. The ImageView is then used with the actual width / height of the image to be rendered. Because we are not setting a top,left,right,bottom properties, the ImageView will render itself centered in the parent view, with its overflow hidden.
This provides the desired effect as shown in the image below.
I think you mean the image property of the ImageView and not the backgroundImage. If you use a normal view and set the backgroundImage it will be stretched. From the docs:
Specifying either a width or height property for this view will scale
its image(s) with the aspect ratio maintained, up to a maximum size
that does not exceed its parent view.
If you want to center the image you could just place it in a View and set the width/height to the max value (or calculate the aspect ratio and set both values corretly) and it will be centered in the surrounding View
XML
<Alloy>
<Window >
<ImageView id="img"/>
</Window>
</Alloy>
JS
$.img.image = "/images/1.jpg";
$.img.width = 200;
$.index.open();
Image original size: 1080x720. Display inside the app: 200px width not stretched and in the middle of the window (Android, Ti 5.1.2, TiShadow on device)

Image width 100% - scaleMode flex mobile

I have a view in my flex mobile application, in which I have a lot of pictures which should shown in VGroup. The pictures are 851x315, they should have width="100%". About and under the picture are white areas. I want put the next picture direct under the picture without any white areas.
Here a screenshot (I have scrolled on the screen, so that's better to see):
Have you tried setting the VGroup gap and padding to zero.
<s:VGroup gap="0" paddingTop="0" paddingBottom="0" paddingRight="0" paddingLeft="0">
...
</s:VGroup>

Image slider with different image widths slide

I have a div width lets say width:900px; height:300px; overflow:hidden;
Into the div there are some images with height:300px and different widths and a small right margin/padding of 10px;
So there will be 2 or more images visible in the holder.
I need 2 buttons which slides the images to the 0 point (left:0;).
So when I press on the next arrow the next image (which can be already be visible for a small part) slides to the left at the 0 point.
I can't find any sliders which works like that :(
EDIT FOUND IT!
http://jquery.lemmonjuice.com/plugins/slider-variable-widths.php

Irregular layout in wp7 what can i do?

See this Chart
rules:
car1 car2
car3 car4
If news has image then use car1 and car3 layout ;not image ,use car2 or car3 layout. If news has large image then it height equal car1 height + car3 height or car2 height+car4 height
My question: how use listbox dispose the Irregular layout in WP7 ?
There is no straight forward answer to your problem. Shortly, you cannot do it readily. That is there is no "irregular" layout manager with the standard libraries (e.g. something like Grid or Stackpanel). Perhaps there is 3rd party library out there but i am not aware. If there is nothing out of the box, you have 2 options:
Make each listbox item a 2x2 grid and then have some logic behind for hiding content of a cell when an adjescent cell grows its rowspan to 2. Vice versa when a big tile becomes a smaller one then you have to change the rowspan and make the hidden tile visible again. I am taking about collapsing or making visible here as an effect. But, you could of course remove the tile and append it to the end of the list. There are many options on how you want your list to behave.
You could consider using a WrapPanel (from silverlight toolkit) inside a scrollviewer to achieve a similar effect. Again, you would have to do some work here as well for reorganizing the container.

Getting Windows 8 UI Control to fill entire horizontal space

For a Windows 8 Metro app, I have a Rectangle inside of a Canvas inside of the main Grid, such that:
<Grid>
...
<Canvas>
<Rectangle />
...
</Canvas>
</Grid>
How would I make the rectangle dynamically take up the width of the screen?
Canvas does not constrain or change its children's size or positions. If you want your rectangle to be as long as the screen width I recommend to put it inside the Grid, as the Grid has the size you need for the Rectangle (with HorizontalAlignment="Strech"). Or you might bind Rectangle.Width to Grid.ActualWidth.

Resources