单击TTStyledTextLabel上的URL链接不会推送新页面

时间:2021-01-18 21:12:40

When I am clicking URL link on TTStyleTextLabel, it doesn't push a new page. But when I looked at the TTCatalog, they don't have any method in the styledtexttestcontroller which seem to open up the webpage. So how does TTCatalog do that? How can I do that?

当我单击TTStyleTextLabel上的URL链接时,它不会推送新页面。但是当我查看TTCatalog时,他们在styledtexttestcontroller中没有任何方法似乎打开了网页。那么TTCatalog如何做到这一点?我怎样才能做到这一点?

1 个解决方案

#1


2  

Make sure that you have the TTNavigator to map from url to TTWebController. In the sample TTCatalog app you have:

确保您有TTNavigator从url映射到TTWebController。在示例TTCatalog应用程序中,您有:

[map from:@"*" toViewController:[TTWebController class]];

This will let the http:// be mapped to TTWebController in case it does not have any other mapped view controller.

这将使http://映射到TTWebController,以防它没有任何其他映射的视图控制器。

#1


2  

Make sure that you have the TTNavigator to map from url to TTWebController. In the sample TTCatalog app you have:

确保您有TTNavigator从url映射到TTWebController。在示例TTCatalog应用程序中,您有:

[map from:@"*" toViewController:[TTWebController class]];

This will let the http:// be mapped to TTWebController in case it does not have any other mapped view controller.

这将使http://映射到TTWebController,以防它没有任何其他映射的视图控制器。