首页 \ 问答 \ 确定UIPickerWheel是否正在滚动(Determining if UIPickerWheel is scrolling)

确定UIPickerWheel是否正在滚动(Determining if UIPickerWheel is scrolling)

嘿,有没有办法确定UIPickerView目前正在滚动,我真的需要我的应用程序的功能,这是非常重要的。 谢谢!


Hey, is there any way to determine is UIPickerView is scrolling currently, I really need that functionality for my app, it's really important. Thanks!


原文:https://stackoverflow.com/questions/5304839
更新时间:2022-10-20 22:10

最满意答案

举个例子后,我改变了解决方案

 mat <- cbind(dat,
 c(c(NA,NA),head(dat$id,-2)),
 c(c(NA),head(dat$val,-1)),
 c(tail(dat$id,-1),c(NA)),
 c(tail(dat$val,-2),c(NA,NA)))


colnames(mat) <- c('id','val','idp','valp','idn','valn')

   id val idp valp idn valn
1   1   1  NA   NA   2    3
2   2   2  NA    1   3    4
3   3   3   1    2   4    5
4   4   4   2    3   5    6
5   5   5   3    4   6    7
6   6   6   4    5   7    8
7   7   7   5    6   8    9
8   8   8   6    7   9   10
9   9   9   7    8  10   NA
10 10  10   8    9  NA   NA

After your give the example , I change the solution

 mat <- cbind(dat,
 c(c(NA,NA),head(dat$id,-2)),
 c(c(NA),head(dat$val,-1)),
 c(tail(dat$id,-1),c(NA)),
 c(tail(dat$val,-2),c(NA,NA)))


colnames(mat) <- c('id','val','idp','valp','idn','valn')

   id val idp valp idn valn
1   1   1  NA   NA   2    3
2   2   2  NA    1   3    4
3   3   3   1    2   4    5
4   4   4   2    3   5    6
5   5   5   3    4   6    7
6   6   6   4    5   7    8
7   7   7   5    6   8    9
8   8   8   6    7   9   10
9   9   9   7    8  10   NA
10 10  10   8    9  NA   NA

相关问答

更多
  • 我们可以通过'name'列将data.frame split为list , cbind list元素。 我们可以使用sub或paste更改列名。 res <- do.call(cbind,split(df[-1], df$name)) colnames(res) <- sub('([^.]+)\\.([^.]+)', '\\2_\\1', colnames(res)) res # MeasA_A MeasB_A MeasA_B MeasB_B #1 1 7 4 ...
  • OP请求reshape包的cast()函数的参数的帮助。 然而, reshape包被来自同一个包作者的reshape2包所取代。 根据软件包描述, reshape2软件包是 重新打包重新包装 使用reshape2 ,可以产生所需的结果 reshape2::dcast(wc, PARENT_MOL_CHEMBL_ID ~ TARGET_TYPE, fun.aggregate = length, value.var = "TARGET_TYPE") # PARENT_MOL_ ...
  • 更新: 感谢@aelwan捕获错误,更新后的代码如下: library(ggplot2) library(reshape2) # read in the data dfStage = read.csv("reshapeR/Data/stage.csv", header = FALSE, stringsAsFactor = FALSE) # remove the rows which are min, max, mean & redundant columns condMMM = stringr::str ...
  • 列必须是一种数据类型 ; 你不能混合逻辑和数字。 不确定如何对多种不同的数据类型进行“长期”分析,因为通常这些变量具有不同的分组。 如果需要,请尝试首先将逻辑值转换为数字(使用as.numeric )。 当你没有使用reshape包时,Hadley在他对melt()函数的讨论中提出了这一点,该函数执行相同的任务(例如参见本文 ): 在[熔化]的当前实现中,只有一个假设是熔化:所有测量值必须是相同的类型,例如数字,因子,日期。 我们需要这个假设,因为熔融数据存储在R数据帧中,而值列只能是一种类型 。 大多数情 ...
  • 这是一种似乎可行的方法。 它使用我的“splitstackshape”包中的expandRows和getanID ,然后dcast.data.table “data.table”中的dcast.data.table将值传播为一种宽泛的形式: as.is$Start.Date <- as.Date(as.character(as.is$Start.Date), "%d.%m.%Y") library(splitstackshape) dcast.data.table( getanID( expa ...
  • 我们可以使用reshape2从'wide'转换为'long'格式。 我们在measure指定列索引。 library(reshape2) dM <- melt(df1, measure=3:5)[-1] 然后order 'method'列获得预期的输出 dM1 <- dM[order(dM$method),] row.names(dM1) <- NULL dM1 # method variable value #1 A Day1 4,5 #2 A day2 ...
  • 这是一种可能的方法。 它使用ave根据“id”出现的次数创建“时间”变量,对我来说,听起来就像你正在寻找的那样。 您的数据,但有序(并使用set.seed以便其他人可以重现它): set.seed(1) h <- seq(from=as.Date("2005-06-01"), to=as.Date("2008-06-30"), by=1) a <- data.frame(id=sample(c(1:100), 300, replace=TRUE), val ...
  • 举个例子后,我改变了解决方案 mat <- cbind(dat, c(c(NA,NA),head(dat$id,-2)), c(c(NA),head(dat$val,-1)), c(tail(dat$id,-1),c(NA)), c(tail(dat$val,-2),c(NA,NA))) colnames(mat) <- c('id','val','idp','valp','idn','valn') id val idp valp idn valn 1 1 1 NA NA ...
  • 您可以使用“reshape2”中的melt和dcast来获得(我认为)您想要的内容: library(reshape2) mydf <- melt(ar_waste_sep, id.vars="Householdref") head(mydf) # Householdref variable value # 1 003015002024001 B5_Glass FALSE # 2 003016003006001 B5_Glass FALSE # 3 003016004013001 B5_Glass ...
  • 这是一个使用apply的方法,它返回一个列表,其中列表项名称是行名: # construct reproducible example set.seed(1234) df <- data.frame(apple=sample(c(0,1), 10, replace=T), banana=sample(c(0,1), 10, replace=T), carrot=sample(c(0,1), 10, replace=T)) # give i ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)