iPad 1显示纵向模式而不是横向(iPad 1 showing portrait mode instead of Landscape)
我在AppStore上有一个应用程序,它在iPhone上有纵向模式,在iPad上可以在横向上运行。 但是我得到的报告显示它在iPad 1上显示肖像因此破坏了整体视图。
为什么iPad 1专门显示人像模式? iPad的版本是5.1.1
I have an application on AppStore that has portrait Mode on iPhone and on iPad it works on landscape. However i am getting reports that it shows portrait on iPad 1 thus destroyed overall View.
Why is iPad 1 specifically showing Portrait mode? The version of iPad is 5.1.1
原文:https://stackoverflow.com/questions/19164457
最满意答案
尝试更改注册属性路由的顺序:
// This must come first config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
此外,如果您始终使用基于属性的路由,我建议您删除默认路由注册。
Try changing the order in which you register the attribute routes:
// This must come first config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
Also if you always use attribute based routing I would recommend you removing the default route registration.
相关问答
更多-
尝试更改注册属性路由的顺序: // This must come first config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); 此外,如果您始终使用基于属性的路由,我建议您删除默认路由注册。 ...
-
请使用System.Web中的属性。 您的WebAPI操作上的Http命名空间: [System.Web.Http.AcceptVerbs("GET", "POST")] [System.Web.Http.HttpGet] public string Auth(string username, string password) {...} 它不起作用的原因是因为您正在使用来自MVC命名空间System.Web.Mvc的属性。 System.Web.Http命名空间中的类用于 ...
-
在搜索了几个小时的文档之后,我找到了URLSearchParams并决定尝试一下,看看它是否有效。 以下是最终解决方案 let headers = new Headers({'Content-Type': 'application/x-www-form-urlencoded'}); let options = new RequestOptions({headers}); let body = new URLSearchParams(); body.append('client_id', env.M ...
-
您应该在POST请求上调用API / Regions,而不是API / Regions / Create,除非您在操作的Route属性中指定API / Regions / Create。 WebApi将知道要搜索哪种方法来处理请求。 You should call API/Regions on your POST request, not API/Regions/Create, unless you specify API/Regions/Create in a Route attribute on the ...
-
@ stephen.vakil 如果您希望它自动正确映射您的路线,则参数名称需要匹配。 它不会自动将id映射到panelId @stephen.vakil If you want it to map your route correctly automatically, the parameter names need to match. It won't automatically map id to panelId
-
去除 [AcceptVerbs("POST", "Get")] 并改变 [System.Web.Http.HttpPost] 至 [System.Web.Http.HttpPut] HttpPost是AcceptVerbs(“POST”)的简写。 不知道你在哪里告诉控制器接受PUT。 我不认为你可以有一个单一的控制器方法接受多个动词,即使你能让我觉得更清洁的实现是两个同名的方法,一个用HttpGet装饰,一个用HttpPut装饰。 remove the [AcceptVerbs("POST", "Ge ...
-
您可能错过了对HttpConfiguration.EnableCors的更高级别调用,如下所述: https : HttpConfiguration.EnableCors 。 将此代码添加到您的配置中: public static void Register(HttpConfiguration config) { // New code config.EnableCors(); } You've probably missed the higher level call to HttpCo ...
-
请求的资源不支持http方法'get'。(the requested resource does not support http method 'get'. Cross Domain)[2022-05-14]
好的,我知道了! 在没有找到解决方案的直接方式之后,我将Controller作为我的中间...将表单数据发送到Controller,它具有JsonResult Action方法。 在这个方法中,我通过HttpWebRequest与我的外部Web Api进行通信,并通过Httpreponse将json数据发送回我的视图。 哦,哦,我的天啊...... OK got it! After not finding a solution the direct way, i took the Controller as ... -
由于您确定要通过POST请求,但错误明确表示您正在尝试GET,唯一有意义的是发生了重定向。 重定向实际上将返回带有Location标头的301或302。 然后,客户端通过GET请求新URL,即使原始请求是POST。 换句话说,流程将类似于:POST - > 302 - > GET - > 405。 Since you're sure you're requesting via POST, but the error unambiguously says you're attempting a GET, th ...
-
除非操作具有正确映射的路由,否则提供的请求http://myURL/api/XMLInput将与您的操作不匹配 [RoutePrefix("api")] public class MyController : ApiController { //POST api/XMLInput [Route("XMLInput")] [HttpPost] public IHttpActionResult PostXMLInput([FromBody] XmlDocument xml) { ...