移动应用认证/ Sencha Touch(Mobile App Authentication/Sencha Touch)
我正在尝试使用最终针对iOS和Android的Sencha Touch编写应用程序。 它应该登录到公司Web服务器,然后检索并解析一些JSON数据。 它应该很简单。 但是我对Sencha和Javascript都很新,所以我很难做这种客户端身份验证。 我甚至无法通过我的开发机器上的Web浏览器进行身份验证。
我使用此链接来帮助创建我的登录页面:
http://miamicoder.com/2012/adding-a-login-screen-to-a-sencha-touch-application/但是当我尝试登录时,我似乎得到以下错误消息和一个null对象:
XMLHttpRequest cannot load https://www.server.com/index.html?=_dc1234567890123 Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin.
有没有人有任何建议或良好的资源让这个应用程序登录? 任何帮助将不胜感激!
I'm trying to write an app using Sencha Touch that ultimately targets iOS and Android. It's supposed to log into the corporate web server and then retrieve and parse some JSON data. It should be very simple. However I'm very new to both Sencha and Javascript, so I'm having a hard time doing this sort of client-side authentication. I can't even seem to make it authenticate from a web browser on my dev machine.
I used this link to help create my login page:
http://miamicoder.com/2012/adding-a-login-screen-to-a-sencha-touch-application/But when I attempt to log in I seem to get the following error message and a null object:
XMLHttpRequest cannot load https://www.server.com/index.html?=_dc1234567890123 Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin.
Does anyone have any advice or good resources on getting this app to log in? Any help would be greatly appreciated!
原文:https://stackoverflow.com/questions/19366557
最满意答案
大声笑,好吧,我知道你要去哪里。 所以你需要做的是有一个外部的tableview。 这将是滚动并包含多个帖子的数据的那个。 那么你只需要一个原型单元。 该原型单元格应该有一个UITextView和下面的另一个 tableview,用于与该帖子关联的图像。 单元格中的此表视图不应滚动,但应该可以调整大小; 我明白。 在界面构建器中,您可以取消选择可滚动的复选框,并使用约束使其可调整大小。
现在就是诀窍,图像tableview的数据源需要是包含它的单元格。 您的outertableview的数据源将是其控制器。
那有意义吗?
Lol, ok I see where you're going with this. So what you will need to do is have an outer tableview. This is going to be the one that scrolls and contains the data of multiple posts. Then you only need one prototype cell. That prototype cell should have a UITextView and another tableview underneath for the images associate with that post. This tableview in the cell should not scroll, but should be resizable; I understand. In interface builder you can deselect the scrollable checkboxes, and use constraints to make it resizable.
Now here's the trick, the datasource for your images tableview needs to be the cell that contains it. The datasource for your outertableview will be its controller.
Does that make sense?
相关问答
更多-
UITableView在UIScrollView中滚动问题(UITableView scrolling problems when inside a UIScrollView)[2023-10-18]
我会检查的事情: 检查你的视图层次结构 - 东西是放在你的UITableView的顶部,导致它不接收一个水龙头? 你的UITableViews在任何地方都被禁用了吗? 我将在tableView:didSelectRowAtIndexPath:设置一个断点tableView:didSelectRowAtIndexPath:并查看该方法是否被调用。 检查这个职位 我想这些并不是肯定的答案,但希望他们能帮助发现问题! Things I would check: Check your View Hierarchie ... -
UITableView无限滚动(UITableView infinite scrolling)[2019-11-19]
如果你需要知道你在UITableView的底部什么时候成为它的委托(因为它是UIScrollView的一个子类),并使用-scrollViewDidScroll:delegate方法来比较表的内容高度和它的实际滚动位置。 编辑(这样): - (void)scrollViewDidScroll:(UIScrollView *)scrollView_ { CGFloat actualPosition = scrollView_.contentOffset.y; CGFloat conte ... -
首先,那些其他意见(表视图的兄弟姐妹)是否严格在表格视图之下? 如果是这样,是否考虑让表格视图正常滚动,并将这些外部视图放在表视图的页眉和页脚视图中? 那么你不需要滚动视图。 其次,您可能想要阅读技术说明TN2154:UIScrollView和Autolayout(如果还没有)。 第三,鉴于该技术说明中的信息,我可以想到几种方法来做你想要的。 最干净的可能是创建UITableView的子类,实现intrinsicContentSize方法。 实施是微不足道的: @implementation MyTable ...
-
我在tableview上使用“hitTest”修复它。 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event 如果事件源自tableview,我将禁用父级的scrollview滚动。 并且,当tableview的滚动结束时(scrollViewDidEndDragging),我重新启用父级的滚动视图滚动。 接缝工作正常。 I fixed it using "hitTest" on the tableview. - (UIView * ...
-
你应该禁用弹跳你不想反弹的东西。 (也是一个美好的生活座右铭。) self.scrollView.bounces = NO; You should disable bouncing for what you do not want to bounce. (Also a good life motto.) self.scrollView.bounces = NO;
-
您可以通过方法计算表视图bin的高度 heightForCellAtIndexPath: 在此方法中,您可以传递每行的高度,您可以通过创建全局变量来计算高度,并在此变量中每次添加行高。 或者你可以通过没有行来找到它*行的高度的行的高度是不变的。 这可能会对你有所帮助。 You can calculate the height of table view bin the method heightForCellAtIndexPath: in this method you pass the heigh ...
-
UIScrollView中的Swift UITableView(不滚动)(Swift UITableView (with out scrolling) in UIScrollView)[2022-06-27]
大声笑,好吧,我知道你要去哪里。 所以你需要做的是有一个外部的tableview。 这将是滚动并包含多个帖子的数据的那个。 那么你只需要一个原型单元。 该原型单元格应该有一个UITextView和下面的另一个 tableview,用于与该帖子关联的图像。 单元格中的此表视图不应滚动,但应该可以调整大小; 我明白。 在界面构建器中,您可以取消选择可滚动的复选框,并使用约束使其可调整大小。 现在就是诀窍,图像tableview的数据源需要是包含它的单元格。 您的outertableview的数据源将是其控制器。 ... -
为整个视图添加UIPanGestureRecognizer 。 存储初始位置,并从当前位置计算它是水平移动还是垂直移动。 (如果x坐标变化多于水平,如果y,则垂直。) 方向清除后,将移动转移到表格视图或滚动视图。 或者更好的解决方案:使用表格视图控制器并添加边缘滑动手势,以便在它们位于标签控制器中时进行切换。 Add a UIPanGestureRecognizer for the entire view. Store the initial location, and from the current l ...
-
UITableView是UIScrollView一个子类。 你试过简单地设置yourTableView.pagingEnabled = YES ? UITableView is a subclass of UIScrollView. Have you tried simply setting yourTableView.pagingEnabled = YES?
-
结束使用UIPageViewController来实现我想要的功能,远比使用UIScrollView好得多。 Ended up using UIPageViewController instead to achieve the functionality I wanted, far better than using a UIScrollView.