小编Eri*_*rik的帖子

使用DatePicker扩展和折叠UITableViewCells

我正在构建一个应用程序,让用户从UITableView中选择日期.tableView是静态的并且是分组的.我已经查看了许多问题,包括这个问题,试图弄清楚如何实现这一目标 - 但似乎没有什么工作是最佳的.Apple的日历应用程序具有非常流畅和漂亮的动画,我所经历的所有示例都没有设法重新创建.

这是我想要的结果:

就地日期选择器

有人可以指点我一个教程或解释我如何用最简洁直接的方式完成这样一个流畅的动画,就像我们在日历应用程序中看到的那样?

非常感谢!

埃里克

objective-c datepicker uitableview tableviewcell ios

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

Completely transparent UITabBar in iOS 8

I'm trying to make my tabBar transparent, I've searched but all I found was articles resulting in partly and not fully transparent tabBars and some were for IOS 5, etc.

I would like to accomplish this as seen in Sketch 3:

enter image description here

What's the easiest way to accomplish this?

I thought of doing this:

    // Make the tabBar transparent
self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
self.tabBarController.tabBar.translucent = YES;
Run Code Online (Sandbox Code Playgroud)

but that result wasn't exactly perfect:

enter image description here

Really appreciate help!:)

Sincerely, Erik

Update

// Make the …
Run Code Online (Sandbox Code Playgroud)

objective-c transparent uitabbarcontroller uitabbar ios

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

保存文件 - xmlSerializer

我正在创建一个使用此代码序列化文件的方法:

public void Save(Object file, Type type, String path)
{
    // Create a new Serializer
    XmlSerializer serializer = new XmlSerializer(typeof(type));

    // Create a new StreamWriter
    StreamWriter writer = new StreamWriter(@path);

    // Serialize the file
    serializer.Serialize(writer, file);

    // Close the writer
    writer.Close();
}
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试构建时,Visual Studio告诉我:"错误1找不到类型或命名空间名称'type'(您是否缺少using指令或程序集引用?)c:\ users\erik\documents\visual studio 2013\Projects\FileSerializer\FileSerializer\Class1.cs 16 65 FileSerializer"

为什么是这样?

**编辑*

适用的新代码:

public void Save(Object file, String path, Type type)
{
    // Create a new Serializer
    XmlSerializer serializer = new XmlSerializer(type);

    // Create a new StreamWriter
    TextWriter writer = …
Run Code Online (Sandbox Code Playgroud)

c# xml serialization xml-serialization streamwriter

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

半透明的UINavigationBar

我无法使我的UINavigationBar完全透明,只显示白色文本和按钮,因此我用于ViewController背景的ImageView在顶部完全可见.

我已尝试过其他代码:

    // Set the BarTintColor to translucent and text colors to white
self.navigationController.navigationBar.barTintColor = [UIColor clearColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
Run Code Online (Sandbox Code Playgroud)

不过是结果,一个黑色的UINavigationBar的,我怎么能解决这个问题?

该应用程序从此ViewController推送到此ViewController,其中UINavigationBar淡出为红色.还有其他几个ViewControllers执行相同的淡入淡出动画,因此需要UINavigationBar

带有"Ny"按钮的第一个ViewController的部分将得到改进;) - 只需要开始使用像Photoshop这样的工具

谢谢!埃里克

objective-c uinavigationbar uiviewcontroller uicolor ios

6
推荐指数
1
解决办法
4217
查看次数

iOS 7内容延伸到几个UITableViewCells

后续问题我的另一个问题"iOS tableView with time at left"

我正在尝试使用GitHub上的这个项目来实现像这样的应用程序这样的日历

在此输入图像描述

我尝试使用CollectionView和CollectionViewController创建一个ViewController,然后导入"MSCollectionViewCalendarLayout"标头和实现文件,并将它们设置为CollectionView的自定义布局.

尝试从工作区文件构建给我这个错误:

命令/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang失败,退出代码为1

试图从Xcode项目文件构建给我这个错误以及上面的错误:

找不到RestKit.h文件

使用每个项目的简单结构开始使用此项目的正确方法是什么?

我似乎无法找到任何教程或类似的说明如何开始.

我的问题如下:有人可以帮助我解释如何在不使用SeatGeek API的情况下开始使用它吗?

非常感谢您的帮助!

xcode objective-c ios uicollectionview uicollectionviewlayout

5
推荐指数
1
解决办法
272
查看次数

无法更改HTML和JavaScript中的按钮文本

我正在尝试使用此代码更改按钮的文本,但我没有得到任何反应.这应该是好的,看看我读过的所有内容 - 但它不会改变文本.我在这做错了什么?

<!DOCTYPE html>
<html>
<head>
    <script>
        function changeText() {
            document.getElementById('myButton').value = "New value";
        }
    </script>
</head>
<body>
    <button id="myButton" onclick="changeText()">Change my text!</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript

4
推荐指数
1
解决办法
2669
查看次数

在状态栏下显示tableView

我试图UITableView在应用程序启动时在状态栏下显示我的内容(现在可以通过滚动来实现)。

这是我目前的结果:

在此输入图像描述

但我希望它看起来像这样:

在此输入图像描述

我已经为UINavigationController

在此输入图像描述

我尝试像这样调整插图viewDidLoad

[self.tableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];
Run Code Online (Sandbox Code Playgroud)

但是,它没有按预期显示。

objective-c uitableview uinavigationcontroller ios

4
推荐指数
1
解决办法
3530
查看次数

管理从普通NavigationBar到透明NavigationBar的转换

我需要管理嵌入在NavigationController中的两个ViewController之间的转换,该控件使用标准的浅色模糊层.应用程序的这一部分中的所有ViewControllers看起来都很好用这个模糊的图层除了一个,而我希望它淡出成为一个完全透明的条,并在我弹出这个ViewController时恢复正常.

期望的行为:

在此输入图像描述

我已经研究了很长一段时间,但我无法弄清楚如何实现它.任何人都可以帮助我吗?我调查了这个问题但我不太明白如何实现它.

谢谢!

objective-c uinavigationbar uinavigationcontroller uinavigationitem ios

3
推荐指数
1
解决办法
1600
查看次数

UICollectionView看起来像iOS日历应用程序的最佳方法

我正在构建一个应用程序,我真的需要显示一个类似于iOS日历应用程序中的列表.我需要创建一个collectionView,我可以在其中扩展足以覆盖各自小时的单元格,如下所示:

在此输入图像描述

我尝试了各种各样的东西,包括在Github的这个项目,我不明白如何在另一个项目中使用

除了这个项目,我还快速使用UITableViewController进行了探索不同的方法:

在此输入图像描述

但我并没有真正得到我想要的地方.我需要在第一张图片中看到设计,并想知道是否有人能指出我正确的方向来实现这一目标?

非常感谢你的帮助!!

更新:

实际的单元格框架不应该代表一个小时的开始,在这个例子中是10:00吗?(而不是定制的分隔符)

在此输入图像描述

更新

为什么层次结构如下所示:

在此输入图像描述

这种定位似乎是"阻挡"细胞的触摸,并且该didSelectItemAtIndexPath方法不会被调用.这适用于比其他单元更靠后的单元格.

在此输入图像描述

objective-c uitableview ios uicollectionview

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

将图像上传到Firebase

我正在尝试将图像上传到Firebase,如下所示:

Firebase *ref = [[Firebase alloc] initWithUrl:@"https://<app-name>.firebaseio.com/posts"];
Firebase *newPost = [ref childByAutoId];

NSDictionary *newPostData = @{
                              @"image" : [self encodeToBase64String:image]
                              };
[newPost updateChildValues:newPostData];
Run Code Online (Sandbox Code Playgroud)

我正在使用此代码对图像进行编码:

- (NSString *)encodeToBase64String:(UIImage *)image {
return [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
}
Run Code Online (Sandbox Code Playgroud)

但是这不起作用,因为字符串超过了最大大小:

Terminating app due to uncaught exception 'InvalidFirebaseData', reason: '(updateChildValues:) String exceeds max size of 10485760 utf8 bytes:

我该怎么做才能解决这个问题?在使用Firebase时,我没有在iOS开发和图像方面找到任何在线内容.

compression objective-c uiimage ios firebase

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