小编Dan*_*iel的帖子

如何在不损失视网膜显示质量的情况下将UIView捕获到UIImage

我的代码适用于普通设备,但在视网膜设备上会产生模糊图像.

有人知道我的问题的解决方案吗?

+ (UIImage *) imageWithView:(UIView *)view
{
    UIGraphicsBeginImageContext(view.bounds.size);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage * img = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return img;
}
Run Code Online (Sandbox Code Playgroud)

image-capture scale uikit uiimage retina-display

293
推荐指数
9
解决办法
15万
查看次数

Objective-C:如何获取路由器地址?

我试着以这种方式获取路由器地址.

- (NSString *) routerIp {

  NSString *address = @"error";
  struct ifaddrs *interfaces = NULL;
  struct ifaddrs *temp_addr = NULL;
  int success = 0;

  // retrieve the current interfaces - returns 0 on success
  success = getifaddrs(&interfaces);
  if (success == 0)
  {
    // Loop through linked list of interfaces
    temp_addr = interfaces;
    while(temp_addr != NULL)
    {
      if(temp_addr->ifa_addr->sa_family == AF_INET)
      {
        // Check if interface is en0 which is the wifi connection on the iPhone
        if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"])
        {
          // Get …
Run Code Online (Sandbox Code Playgroud)

iphone router objective-c ip-address

7
推荐指数
2
解决办法
2万
查看次数

Objective-C:没有pagingEnabled的无尽的UIScrollView

在我的iPhone应用程序中,有一个滚动pagingEnabled=NO视图,最多可包含200 个子视图(150 x 150),挑战是在水平方向上进行延迟加载和模拟无限滚动(无弹跳).

这个请求有解决方案或替代方案吗?

paging lazy-loading objective-c uiscrollview

2
推荐指数
1
解决办法
7032
查看次数

使用TTNavigator时如何隐藏UINavigationBar(Three20 v1.0a2)

我想在TTNavigator提供的TTViewController中隐藏UINavigationBar.

有没有办法存档?

iphone hide uinavigationbar three20 ttnavigator

0
推荐指数
1
解决办法
1838
查看次数