对于想了解iPhone的App嵌入html页面问题的读者,本文将提供新的信息,我们将详细介绍怎么在app中嵌入h5页面,并且为您提供关于asp.net-mvc–使用cshtml页面的angularjs
对于想了解iPhone的App嵌入html页面问题的读者,本文将提供新的信息,我们将详细介绍怎么在app中嵌入h5页面,并且为您提供关于asp.net-mvc – 使用cshtml页面的angularjs不是带有web api 2的html页面、c# – 是否有支持嵌入HTML页面的跨操作系统GUI框架?、flex页面中嵌入html页面、Html Javascript 嵌入Html需知的有价值信息。
本文目录一览:- iPhone的App嵌入html页面问题(怎么在app中嵌入h5页面)
- asp.net-mvc – 使用cshtml页面的angularjs不是带有web api 2的html页面
- c# – 是否有支持嵌入HTML页面的跨操作系统GUI框架?
- flex页面中嵌入html页面
- Html Javascript 嵌入Html需知
iPhone的App嵌入html页面问题(怎么在app中嵌入h5页面)
测试环境:iPhone ios 11.0.3
问题:iPhone App嵌入HTML页面,页面拉动到底部时,手势从屏幕底部边缘开始往上拉动,页面出现白色图层,且html页面一屏外的会卡住,无法滚动,需再次滚动html页面方才显示出来。见图1-1
原因:ios的回弹机制scrollview的属性bounces,当scrollview的显示超过内容区域的边缘以及返回时,是否有弹性,默认值为YES,需要禁止时,改为NO
方案:将ios开发的属性bounces的属性设置为NO即可
注意点:bounces属性为NO,即禁止上拉的同时也将上拉刷新的功能关闭了【如需共存,ios开发大神辛苦解决啦】
asp.net-mvc – 使用cshtml页面的angularjs不是带有web api 2的html页面
我已经按照以前的要求构建了HTML页面和WEB API 2.
现在由于某种原因,我必须使用CSHTML页面.以前我只有web api项目模板所以我不能用cshtml页面,因为只有MVC控制器可以返回部分页面(cshtml),但我只使用web apis …
所以改变了整个项目模板,所以现在我可以拥有mvc控制器……
总之,目前我已经建立了web apis和html页面的mvc4项目…..
我只是想使用CSHTML页面而不是使用HTML页面休息的东西应该是它们……
可能吗?
我可能听起来很傻但现在需要它.帮助将不胜感激……
仅限Web apis,cshtml页面和angularjs.不是web apis,html pages和angularjs.
如果我用cshtml替换html页面,角度路由会受到什么影响?
解决方法
有像这样的index.cshtml
@using System.Web.Optimization @inherits System.Web.Mvc.WebViewPage @{ Layout = null; }<!DOCTYPE html> <html data-ng-app="MyProject"> <head> <title data-ng-controller="TitleCtrl" data-ng-bind="Title">My Project</title> <Meta http-equiv="X-UA-Compatible" content="IE=edge" /> <Meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <Meta http-equiv="cache-control" content="max-age=0" /> <Meta http-equiv="cache-control" content="no-cache" /> <Meta http-equiv="expires" content="0" /> <Meta http-equiv="expires" content="Tue,01 Jan 1980 1:00:00 GMT" /> <Meta http-equiv="pragma" content="no-cache" /> @Styles.Render("~/Content/min/css") </head> <bodyid="body"> <divdata-ui-view="body"></div> @Scripts.Render("~/js/angular") @Scripts.Render("~/js/MyProject") </body> </html>
注意:使用角度UI-Router,这就是ui-view所在的原因
但仍然必须有HomeController:
public class HomeController : Controller { public ActionResult Index() { // below I do some tricks to make app running on // http://mydomain/app as well as on // http://mydomain/app/ (see the / at the end) var root = VirtualPathUtility.ToAbsolute("~/"); var applicationPath = Request.ApplicationPath; var path = Request.Path; var hasTraillingSlash = root.Equals(applicationPath,StringComparison.InvariantCultureIgnoreCase) || !applicationPath.Equals(path,StringComparison.InvariantCultureIgnoreCase); if (!hasTraillingSlash) { return Redirect(root + "#"); } // my view is not in Views,but in the root of a web project return View("~/Index.cshtml"); } }
所以,这样我可以使用Bundle配置(javascript,css)的功能……同时在http:// mydomain / app或http:// mydomain / app /启动角度.检查类似here
同样在global.asax中,我们应该配置ASP.NET MVC:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("fonts*.woff"); routes.MapRoute( name: "Default",url: "{controller}/{action}/{id}",defaults: new {controller = "Home",action = "Index",id =UrlParameter.Optional} ); }
而web API应该是:
const string IdPattern = @"\d+|[A-Za-z]{1,2}"; public static void SetRouting(HttpConfiguration config) { // some custom routes ... // and a default one config.Routes.MapHttpRoute( name: "DefaultApi",routeTemplate: "api/{controller}/{id}",constraints: new { id = IdPattern },defaults: new { id = RouteParameter.Optional } );
c# – 是否有支持嵌入HTML页面的跨操作系统GUI框架?
我需要它有一个API来在应用程序和网页之间进行交流.
我知道C#,JavaScript和一些python.
解决方法
flex页面中嵌入html页面
使用flex-iframe插件
在gitHub上的地址如下
https://github.com/flex-users/flex-iframe
可以这样引入这个插件
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:ic="http://www.supermap.com/iclient/2010" xmlns:is="http://www.supermap.com/iserverjava/2010" xmlns:flexiframe="com.google.code.flexiframe.*" width="100%" height="100%" creationComplete="initApp()">
如上面引入了xmlns:flexiframe="com.google.code.flexiframe.*这样一行
在flex页面中
这样使用
<flexiframe:IFrame id="iFrame" width="392" height="100%" label="wgdy" source="{wgdyHtmlUrl}"> </flexiframe:IFrame>source属性设置要嵌入的html页面,我们可以在flex页面的initApp方法中动态初始化
然后在flex页面中我们可以这样调用
iFrame.callIFrameFunction("glxzq",[xzqbm]);glxzq是html页面中的方法
function glxzq(xzqbm) { document.getElementById("wgdy:xzqbm").value=xzqbm; }
[xzqbm]中[]是规定的,xzqbm是参数
具体可以看官网的使用说明
Html Javascript 嵌入Html需知
(1)、放在底部,虽然放在底部照样会阻塞所有呈现,但不会阻塞资源下载;
(2)、如果嵌入JS放在head中,请把嵌入JS放在CSS前面;
(3)、使用defer;
(4)、不要在嵌入的JS中调用运行时间较长的函数,如果一定要用,可以用setTimeout来调用;
我们今天的关于iPhone的App嵌入html页面问题和怎么在app中嵌入h5页面的分享已经告一段落,感谢您的关注,如果您想了解更多关于asp.net-mvc – 使用cshtml页面的angularjs不是带有web api 2的html页面、c# – 是否有支持嵌入HTML页面的跨操作系统GUI框架?、flex页面中嵌入html页面、Html Javascript 嵌入Html需知的相关信息,请在本站查询。
本文标签: