I want to avoid horizontal wrapping in CARTO Xamarin Mobile SDK.
"Avoid horizontal wrapping" means something like OpenLayers 3's wrapX = false.
Are there any attributes or functions?
I found it by myself.
MapView.Options.SeamlessPanning = false;
You can find this here:
http://cartodb.github.io/mobile-android-samples/com/carto/components/Options.html#setSeamlessPanning-boolean-
Related
I see native android has asymmetrical grid options.
But I am looking for something similar in Xamarin, forms specifically. Can't seem to find anything. Am I stuck resolving this need with a relative layout? As the grid layout does not support this from what I can tell. Any solutions people have seen out there before I spend my night on making something like this.
This can be done in Xamarin Forms using the Grid layout. Set up your grid to have as many rows and columns as you would like and then add the Grid.RowSpan and Grid.ColumnSpan properties on the child views.
You will achieve the same effect.
More info - Present views in grids.
I have a slider in a Xamarin Forms app that I'm trying to change the color of the thumb and the slider bar. In Android it was easy to override this in a renderer, but in iOS it looks like all I can do is change the thumb image. Is it possible to change the bar color? Thanks!
You can use the TintColor:
var slider = new UISlider(View.Frame);
slider.ThumbTintColor = UIColor.Blue;
slider.MinimumTrackTintColor = UIColor.Red;
slider.MaximumTrackTintColor = UIColor.Green;
I also just found a new plugin that does all of that and a lot more. It will probably be overkill for just that but if you plan to do a lot more custom stuff to controls it might be helpful.
I have not tried it myself but I looking forward to using it soon.
XF Gloss
How do you create a drop shadow on a button or label using Xamarin Forms. I am currently using Xamarin Forms 1.3 and trying to do this in XAML if possible. Does anyone have a working example they can point me to.
I have not tried this but you could create 2 instances of the same control and put them both inside a grid so that they lay directly over each other. Then with the first control (underneath) change the opacity to 0.2 so that it is very faint, then give it a small top and left margin so it sits slightly offset from the version above it. This should result in a drop-shadow type of effect.
A much better (but more involved) way of doing this is to subclass the controls you want to add the effect to and then create custom renderers to add the effect for each platform using native code
I'm looking into making a jigsaw game using html5 canvas and JavaScript. I have the images(pieces) in place, and they are draggable, but I'd like the pieces to act like they are on a grid so that when you click and hold while dragging an image it can only be placed on certain tiles within the 3x3 grid.
A similar question was asked on Stack before but the only response pointed to a drupal module and I'm not using drupal. I found one more similar solution online that uses Asp.net but I'm hoping to solve this all on the front-end, and if I have to use some server-side code I only know PHP.
The renderGrid function for canvas it seems, just draws a grid, but doesn't make it functional for snapping objects to certain places.
Does anyone have clues on how to do this?
Use divide/floor down math when setting coordinates. E.g. to space x for each 24 pixels:
var gridx = Math.floor(x/24)*24;
I've spent 2 hours looking for a solution. I need to make a design
like the Youtube UI (Tablet UI) where it shows a vertical scroll, but
in each row there are 4 videos (landscape view). I've tried to do
something similar, but i couldn't =(
Is there any place where i can get the source code of the youtube
application for Tablet? Or maybe some resource to solve this? :(
BTW, my try was designing UI with scrollView, LinearLayout and my_item.xml, i tried to inflate my_item.xml adding programmatically into the linearlayout (horizontal orientation), but it doesn't work in the way that i want. I need something like a linearlayout but with horizontal and vertical orientation at the same time (something like a div).
I was thinking to use a ListView and a custom adapter (with my_item.xml), but i'm not sure if this can be the best solution.
Thxs
You should create seperate resources for each layout.
For example if the user is in Portrait mode you would have the correct layout in.
layout-port: layout for portrait orientation
layout-land: layout for landscape orientation
Read more on providing alternative resources here
Also i would recommend to read more on Handling runtime changes
This will help you with recognizing when the user changes orientation. You could actually use this guide and when the user flips the devices orientation you could then change the layout. Keep in mind hard coding this can be dangerous though. I would recommend using the layout folders.
Good luck!
Finally i solve my problem.
It works with a linearLayout(vertical) and adding linearlayout(horizontal) for each row. And obviously managing my scrollview.
BTW, i still think android should have a layout like a "div".
Thxs all