我有可移动的响应器,但我还需要点击一个才能有一个onPress事件。这可能吗?目前它们是<View>
元素,但如果我将它们更改为<Touchableopacity>
或类似的东西,则会抛出错误。只有<View>
元素可以动画?
答案 0 :(得分:2)
在这里查看
https://github.com/facebook/react-native/issues/3082
cppFunction('double mean_time_diff(DateVector sorted_dates) {
/* Takes a vector of dates sorted in descending order
*/ Returns the mean time difference between dates.
int n = sorted_dates.size();
IntegerVector time_diff;
for(int i=1; i < (n-1); i++){
time_diff.push_back( sorted_dates[i] - sorted_dates[i+1] );
}
int m = time_diff.size();
double total = 0;
for(int i=1; i < m; i++) {
total += time_diff[i];
}
return total / m;
}')
mean_time_difference(sorted_dates)
mean_time_diff(sorted_dates)