MVC4: Disable mobile views on certain controllers - asp.net-mvc

I have got .cshtml and .Mobile.cshtml for all of my views. Is there a way to disable .Mobile.cshtml on certain controllers? For such controllers, I always want to use the normal views instead of mobile views.
Thanks!!

Sorry for sounding stupid. But if you always want to use a normal view, just remove the mobile view from the project.
Edit
To force the browser to load the desktop view on a mobile device you will need to use the BrowserHelper SetOverriddenBrowser
Within your action method you could do something like this
HttpContext.SetOverriddenBrowser(BrowserOverride.Desktop);
Try this link for more help http://blog.mirajavora.com/overriding-browser-capabilities-in-asp.net

Related

embed ios8 share sheet into a frame?

Is it possible to present the standard IOS8 share sheet on a page while also showing other content on that page? We want to have a few other sharing options that are more customized along with a view of the standard share sheet but ideally we don't want the share sheet options to require an additional action (and a window popping up over the other stuff) - we just want everything to appear at once. Possible?
technically.. yes. you could mess with the view structure and modify it to your heartss desire
BUT that would be a nogo if you want to target the App Store
note: I am assuming here that you don't want to just modify the controller as specified by the docs. thats of course possible ;)

ios- create multiple window app

How to create an application to support multiple windows.
So that user can create new or close window simultaneously in the same app like we can see in browsers.
Any suggestion is appreciated.
as of iOS13 and XCode11 you can create multiple window apps for iPad OS by setting the Enable Multiple Windows property in info.plist to YES.
You don't want to use multiple windows. The app could have multiple windows but this wouldn't give you the effect you want (or would be an abusive way of creating it).
Instead, what you want is a container view controller which manages, in a custom way, a number of child view controllers. Think about how a tab view controller works - you want the same thing, just presented in a different way.
Taks a look at HGPageScrollView for inspiration and reuse.

Scrolling app: UIPageViewController vs UIScrollView

I am working on an app in which there are several screens and each screen has the same layout, just different data passed in, then I want the user to be able to swipe from one screen to the next.
So far I got something working using the UIPageViewController project template using the transition style UIPageViewControllerTransitionStyleScroll. What I have done so far works ok, although its resource intensive because it instantiates a new view controller each time I swipe to a new page but I am loooking into working around that.
The thing I am concerned about is that it is not strictly a page application in the sense of ibooks so even though I am able to make it look like a scrolling app, using the transition style setting, I wonder if there is a reason why people seem to only use this template for book type apps, unless I am mistaken
Also there seems to be an alternative approach of using a UIScrollView and PageControl to do similar functionality
http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html
I am not sure which approach is better to solve the problem I am trying to fix, so am looking for some feedback. Each page will need to be a separate instance of a view controller as there are several elements to display on each page.
Using UIScrollView is much more difficult. If you're targeting iOS 6 you should almost certainly use UIPageViewController. If you're targeting iOS 5 then UIPageViewController might not be perfect because the only page transition available is "scroll" which looks like a page flip.
If you're worried about the resource usage, you can reuse view controllers.
See the WWDC 2012 session 223:
https://developer.apple.com/videos/play/wwdc2012/223/

Reusing Views ios

Trying to develop a test app wherethe look is like ebook. user can flip the pages. However, app will have 40-50 pages to go through. Is there anyway to just update one view and even after re using you can easily turn it over and back. or do I have to create more views to achieve objective.
Can someone pls provide suggestion on which technique to use to solve this issue and also what to use for flipping like ebook?
Since you have tagged your question with iOS5 you can use a UIPageViewController (see also this one) to handle this behavior for you (datasource handling, gesture handling etc.). The logic behind it is that you provide an array of view controllers where each one controls and provides content for a page in your book.
One way is, please look in to "page base application". Please create a new project as page base application and work on that. You will find good amount of documentation online for this.

What kind of template for ios application

im trying to build an application like a book, with so many custom views and intensive animations. i want to know what is the best template for this kind of app? single view, view based?
thanks
I would use a "Page Based Application" it comes with an interface that interacts just like a book with paging effects and everything. It uses one viewController that dynamically replaces content based on which page has been navigated to.

Resources