问题描述
当前,我有一个显示记录详细信息的屏幕,还有import numpy as np
from multiprocessing import shared_memory
def store_in_shm(data):
shm = shared_memory.SharedMemory(name='foo',create=True,size=data.nbytes)
shmData = np.ndarray(data.shape,dtype=data.dtype,buffer=shm.buf)
shmData[:] = data[:]
#there must always be at least one `SharedMemory` object open for it to not
# be destroyed on Windows,so we won't `shm.close()` inside the function,# but rather after we're done with everything.
return shm
def read_from_shm(shape,dtype):
shm = shared_memory.SharedMemory(name='foo',create=False)
shmData = np.ndarray(shape,dtype,buffer=shm.buf)
print('From read_from_shm():',shmData)
return shm,shmData #we need to keep a reference of shm both so we don't
# segfault on shmData and so we can `close()` it.
if __name__ == '__main__':
data = np.arange(10)
shm1 = store_in_shm(data)
#This is where the *Windows* prevIoUsly reclaimed the memory resulting in a
# FileNotFoundError because the tempory mmap'ed file had been released.
shm2,shmData = read_from_shm(data.shape,data.dtype)
print('From __main__:',shmData)
shm1.close()
shm2.close()
#on windows "unlink" happens automatically here whether you call `unlink()` or not.
shm2.unlink() #either shm1 or shm2
和PrevIoUs
按钮,用于在不同记录之间导航。我使用Next
作为默认屏幕选项,因此进入新屏幕时动画会向左水平滑动。
对于CardStyleInterpolators.forHorizontalIOS
按钮,我可以正常使用Next
,动画效果也很好。
navigation.replace
对于const showNextSample = () => {
let currentIndex = itemIdList.indexOf(currentId);
let nextIndex = (currentIndex + 1) % itemIdList.length;
let nextId = itemIdList[nextIndex];
navigation.replace('DataEntry',{ ...route.params,sampleid: nextId });
}
按钮,我想反转动画方向,所以我尝试设置PrevIoUs
。但是,切换屏幕时的方向仍然相同(其他功能和记录详细信息仍正常工作)。
gestureDirection
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)