React-native Image ResizeMode:Contain not working - reactjs

I hope there is someone savvy with React Native that can help me out here.
I want to resize an image according to the dimensions of the view that it is placed in. To my understanding that should be achievable by using "ResizeMode: Contain" as a style on the image. That should cause the image to rescale itself to fit within the surrounding view, iff it is too large (according to my understanding) .
I have attached an image that shows the dimensions of the view (the blue bordered view). The dimensions of the views are correct according to the blue border on the view, yet the image is not resized to fit it.
Can someone figure out, what it is that I am doing wrong here, or have I encountered a bug in the framework? (It is a fairly new framework I suppose, so that could actually happen I guess).
If it helps, then I am currently using the following React Native version:
react-native: 0.54.4
(and react-native-cli: 2.0.1 for what it is worth).
Picture of issue (notice the blue box and the wrongly scaled image within it):

resizeMode should be used as a prop instead of a property of the style object
<Image
style={{ ... }}
source={{ ... }}
resizeMode='contain'
/>

Related

Codename One:Container moves down when loading toastbar

I am developing app using codename one .On login screen when toastbar gets loading container moves down.
I have attached screen shot in which i have shown exact error.
If I rotate the device or simulator it produced same effect.I used border layout and value of includeNativeBool = true
Can you please let me know how to resolve it?
Thanks in advance
I have attched screen shots of my form structure
There is no scrollability in this layout. I'm also guessing you assigned percentage heights in the table layout and some nuances might change.
Container1 should be scrollable on the y axis but that might break your entire layout because you rely on problematic behaviors of table layout so it will fit "exactly" it wasn't designed for that.

How to make homepage slider image not scale mobile?

My current homepage banner scales down to mobile and the image & text shrinks to a size that's unreadable.
How can you make it so that after it scales to a certain point the image stops scaling and it just cuts off the width of the image?
My site: www.riotsociety.com
Example site: sunglass.la
Add this into your CSS files.
This will make your slider 70% of the viewport height. So it will take 70% of any device's height.
this will solve the image problem
.fullwidthbanner-container {
height: 70vh; //please work around this value
}
Now the thing is that the Slider's JS is calculating and giving to each element sizes and styling's.
The buttons content becomes 3px in size on mobiles.
Now I see 2 solutions for this.
Read the documentation of the slider library or plugin if there is any and try to make it not give heights and values for the responsive part of the slider and just do it by your own. You'll need a little bit of CSS.
Or, let it as it is and write on top CSS.
Do you have access to the code? Or it's just a shopify website? I can see that the slider is owl_carrousel

Responsive Websites with "cover" background images

I'm designing a responsive site using edge reflow with the following rules for breakpoints:
<480px, <768, 1024>
I'm using a different background picture for each breakpoint of respective widths. However when I add them to Reflow with contain for scale-x it seems as if the image I created is not that size. Most of them were at least 200 pixels shorter than designed.
So my question is what dimensions should I use background images for each breakpoint as well as any other guidance for this using Reflow or suggestions of I'm doing something wrong.
Normally I'd use cover rather than contain but then the image scales and doesn't show what I need it to from device to device.
Thanks

When i do a debug, the pictures went out of place, anyone know why?

I'm using WPF xaml. When i do a debug, the pictures ran out of place from what the design is shown. Any one know why? Beside codes what do i have to add in? Sry first time posting in here. What else must i add on? Btw i'm using VS2010.
<Grid>
<Image Source="C:TV\TV_Page_02.jpg" UseLayoutRounding="True"></Image>
<Image Source="C:TV\2.jpg" UseLayoutRounding="True" Margin="19,74,115,72"></Image>
<Image Source="C:TV\1.jpg" UseLayoutRounding="True" Margin="123,53,47,72"></Image>
</Grid>`
Allright, here's the issue:
"Layout rounding should be used in UI scenarios where the exact location of objects can be sacrificed for overall appearance of the application. Since rounding of layout parameters occurs when using this feature, precise element placement is lost. A few of the effects layout rounding can have on exact layout are…
·width and or height of elements may grow or shrink by at most1 pixel
· placement of an object can move by at most 1 pixel
· centered elements can be vertically or horizontally off center by at most1 pixel
If your app has an unexpectedly blurry image or icon, fuzzy lines or borders that should be crisp, or grid banding try using layout rounding." - Quoted from "WPF Text Blog".
Here's the link to read more about this property:
http://blogs.msdn.com/b/text/archive/2009/08/27/layout-rounding.aspx
Now I guess we now what is the problem (UseLayoutRounding=true). Just remove this property

Is there any way of adding an image to a bar in a chart in ExtJS via the highlight property?

I want to add an icon in the column/bar onMouseOver and was wondering if highlight already supported that. The docs say you can add whatever Sprite has available to the highlight object ( http://docs.sencha.com/ext-js/4-0/#/api/Ext.chart.series.Bar-cfg-highlight however even in the Sprite definition ( http://docs.sencha.com/ext-js/4-0/#/api/Ext.draw.Sprite ) there's no mention of how to do this beyond setting the type to image.
Any ideas would be greatly appreciated.
Thanks!
From the docs there doesn't seem to be an easy way of doing this. The Sprite class supports addCls and removeCls methods though, you could try setting a className to the sprite element and see whether a background image for an element with that className works. Otherwise the sprite element for the bar chart would have to be redefined into something more complex that takes images as a component.
In future, you should post over on the Sencha forums as you will get a quicker response.

Resources