I need to do some Actions on the glisten View based on showing/hiding charm Layer.
The overlay Layer is not add in LayerFactory. It is just shown by Layer.show()
I've found setOnShowing(...), setOnShown(...), setOnHiding(...),setOnHide(...)methods on View but this Events are not fired by overlay with Layer.
Is there some event on View which can indicate this Action?
Related
I have added 3d view objects using urhosharp for my xamarin uwp/ios/android project . The only event that work is touch event, but i also want to use drag and drop so that the objects can move to different locations within the 3D view. Any suggestions?
https://us.v-cdn.net/5019960/uploads/editor/ni/u16pg79v2m62.png
Haven't used urhosharp yet , but here are some suggestions about using of drag and drop, not sure if it helps here for you.
urhosharp: Basic Actions
From document of urhosharp , there is some bascic actions explains,but no drag and drop in it.Maybe you can do it by combining actions and drag methods on each platform. But this requires you to try.
UWP: reference link here
Here's an overview of what you need to do to enable drag and drop in your app:
Enable dragging on an element by setting its CanDrag property to
true.
Build the data package. The system handles images and text
automatically, but for other content, you'll need to handle the
DragStarted and DragCompleted events and use them to construct your
own data package.
Enable dropping by setting the AllowDrop property to true on all the
elements that can receive dropped content.
Handle the DragOver event to let the system know what type of drag
operations the element can receive.
Process the Drop event to receive the dropped content.
Code example:
<Grid AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop"
Background="LightBlue" Margin="10,10,10,353">
<TextBlock>Drop anywhere in the blue area</TextBlock>
</Grid>
private void Grid_DragOver(object sender, DragEventArgs e)
{
e.AcceptedOperation = DataPackageOperation.Copy;
}
IOS: reference link here
With drag and drop in iOS, users can drag items from one onscreen location to another using continuous gestures. A drag-and-drop activity can take place in a single app, or it can start in one app and end in another.
Use drag items to convey data representation promises between a source app and a destination app.
Adopt drag interaction APIs to provide items for dragging.
Adopt drop interaction APIs to selectively consume dragged content.
Demonstrates how to enable drag and drop for a UIImageView instance.
Code of example:
func customEnableDragging(on view: UIView, dragInteractionDelegate: UIDragInteractionDelegate) {
let dragInteraction = UIDragInteraction(delegate: dragInteractionDelegate)
view.addInteraction(dragInteraction)
}
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {
// Cast to NSString is required for NSItemProviderWriting support.
let stringItemProvider = NSItemProvider(object: "Hello World" as NSString)
return [
UIDragItem(itemProvider: stringItemProvider)
]
}
Here is a sample for Xamarin IOS.
Or you can using UIPanGestureRecognizer in IOS to move view.Here is Walkthrough: Using Touch in Xamarin.iOS.All you need to do is let view.center follow panGesture to change.
Android: reference link here
With the Android drag/drop framework, you can allow your users to move data from one View to another using a graphical drag and drop gesture. The framework includes a drag event class, drag listeners, and helper methods and classes.
There are basically four steps or states in the drag and drop process:
Started:In response to the user's gesture to begin a drag, your application calls startDrag() to tell the system to start a drag.
Continuing:The user continues the drag.
Dropped:The user releases the drag shadow within the bounding box of a View that can accept the data.
Ended:After the user releases the drag shadow, and after the system sends out (if necessary) a drag event with action type ACTION_DROP, the system sends out a drag event with action type ACTION_DRAG_ENDED to indicate that the drag operation is over.
Table. DragEvent action types:
Or in Android can use onTouchEvent to move view, need to calculate position of the view.Walkthrough - Using Touch in Android
The main thing is to handle pressing and moving two messages, overloading onTouchEvent. Mathematical knowledge (translation): Record the coordinate point when ACTION_DOWN, and calculate the translation amount according to the current position and the position when pressed at ACTION_MOVE. Refresh the control, causing the control to redraw, and move the coordinates of the upper left corner of the drawing when redrawing.
Here also has a discussion about Drag & Drop in Xamarin forms.It may be helpful.
I want to handle table view didSelectAtRow delegate method in Siri Shortcuts Custom IntentUI.
Also I wan to handle UIButton Action in Siri Shortcuts Custom IntentUI.
Is any of the case possible?
Please share some solution (if possible)
#SiriShortcuts
#iOS12
#Custom IntentUI
You can't handle interactions in a Custom Intent UI as the intent controller does not receive touch interactions. This is from the official documentation -> Check the section requirements and limitations.
You can update your view controllers as needed using timers or other programmatic means. Your view controllers also receive the normal callbacks when they are loaded, shown, and hidden. However, your view controllers do not receive touch events or any other events while they are onscreen, and you cannot add gesture recognizers to them. Therefore, never create an interface with controls or views that require user interactions.
Generally we use UIImagePickerDelegate to get the selected image from user. I need the image after the user captured it without asking usephoto/ cancel. Is it possible?
Step 1 : Remove default camera controls by this method.
[pickerController setShowsCameraControls:NO];
Step 2 : Create an Overlay view and put one button on the overlay view to capture image.Set the view as picker controller's overlay view.
[pickerController setCameraOverlayView:camOverlay];
In the button action write this method:
[pickerController takePicture];
This automatically calls the delegate method and we will get the image directly with out use photo or cancel Step.
NOTE: Source type of picker controller should be camera to implement the above stuff.
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
set delegate to self.
I am using the new UISplitViewController for ios8 that has preferred display modes. My master split view is a UITabBarController with a UINavigationController inside it. I disabled the presentsWithSwipe gesture, and instead have a button in my detail view controller that toggles the splitviewcontroller between 2 preferred display mode states: UISplitViewControllerDisplayModeAllVisible and UISplitViewControllerDisplayModePrimaryHidden.
When I toggle the button so that both view controllers are visible, I can see my navigation controller display it's tableview controller. However, when I click on a cell in my tableviewcontroller that performs a storyboard segue to another view controller, I get the following error:
Unbalanced calls to begin/end appearance transitions for <ReferenceTableViewController: 0x7fde50540d50>
My set up is
SplitMasterViewController --> UITabBarController --> UINavigationController --> ReferenceTableViewController --> ReferenceDetailViewController
SplitDetailViewController --> UINavigationController --> MainViewController
Basically, I want to animate in/out the master view controller which provides information relevant to the MainViewController. Actions taken in the MasterViewController do not replace out the DetailViewController, but rather should navigate within the MasterViewController frame. Kind of like having an iPhone side by side with a smaller iPad, with independent content in each.
However, I'm not getting any of the view appearance methods being called in the ReferenceTableViewController or the RefernenceDetailViewController. I always call super if I override any appearance methods, so I'm not sure where the error is coming from. Any ideas?
I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).
One way, loosely coupling, Create a custom event (SelectAvatarEvent?) with a property for name/id and dispatch it from View1 when the link is clicked. In the Application add an event listener for this custom event, and catch it, change the view index to View2 and create a function/property in View2 that you can pass the string/event to. Depending on how it is implemented, might need to account for delayed instantiation of View2.