切换视图时保持 xcode 中的滑块位置 [英] maintaining slider position in xcode when switching views

查看:33
本文介绍了切换视图时保持 xcode 中的滑块位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对目标 c 非常陌生(三周),而且我已经 70 多岁了,所以不像以前那么快!无论如何,除了在切换视图并再次切换时保持滑块位置和值的问题外,我对 IOS 的应用程序做得很好.澄清一下:我有 3 个视图,每个视图有 4 个滑块,我希望能够返回到任何视图,滑块的位置和值与它们离开时相同.我确定有一种方法可以做到这一点,但我到处搜索都无济于事,所以我希望这里有人可以提供帮助!

I'm very new to objective c (three weeks) and also in my 70s so not as quick as I used to be! Anyway, I'm doing okay with an app for IOS except for a problem with maintaining slider position and value when switching away from a view and back again. To clarify: I have 3 views, each with 4 sliders and I want to be able to return to any view with the sliders positions and values the same as they were left. I'm sure there's a way of doing this but I've searched all over to no avail so I hope someone here can help!

推荐答案

您可以使用 NSUserDefaults 之类的东西保存滑块值.查找更多信息.

You could save the sliders values using something like NSUserDefaults. Look it up for more info.

这篇关于切换视图时保持 xcode 中的滑块位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆