UIMenuController UITableViewCell和UITextView之间的奇怪行为

时间:2015-08-12 13:22:47

标签: ios objective-c uitableview uimenucontroller

在我的应用中,长按一个单元格后根据我的需要配置UIMenuController弹出窗口,选择copy之类的任何选项也工作正常,但之后我点击或长按我的UITextView UIMenuController UITextView仍然会突然显示在我UITextView上的单元格上,但会对Private Sub BW_SBD_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BW_SBD.DoWork 'Background Worker - Do Work Thread Dim currentFrame As New Image(Of Gray, Byte)(FrameHeight, FrameWidh) 'Declare image objects to hold current and previous frame Dim frameCount As Integer = 1 Dim numFrames As Integer 'number of frame for the video For Each file As String In lstbSelectedVideoList.Items ' For Each file As String In files - Loop through the list of files Dim previousFrame As New Image(Of Gray, Byte)(FrameHeight, FrameWidh) Using fingerprintCapture As New Capture(file) ' Create a capture from file numFrames = CType(Math.Round(fingerprintCapture.GetCaptureProperty(CAP_PROP.CV_CAP_PROP_FRAME_COUNT)), Integer) ' Get video's total number of frames frameCount = 1 fingerprintCapture.SetCaptureProperty(CAP_PROP.CV_CAP_PROP_POS_FRAMES, 0) ' Jump to start frame currentFrame = fingerprintCapture.QueryGrayFrame() ' get a frame While fingerprintCapture.GetCaptureProperty(CAP_PROP.CV_CAP_PROP_POS_FRAMES) < 0.0 ' Make sure the start frame was found (codecs create problems with the set frame pos function) currentFrame = fingerprintCapture.QueryGrayFrame() ' get a frame End While While currentFrame IsNot Nothing 'The analysis procedure requires the frames from the video If MyFrameAnalysisFunction(currentFrame, previousFrame) = 1 Then MessageBox.Show('This part is irrelevant') End If previousFrame = currentFrame.Clone() ' Update frame objects by saving previous frame and querying a new one currentFrame = fingerprintCapture.QueryGrayFrame() ' get new frame frameCount += 1 End While End Using Next End Sub 执行操作。为什么?请看截图。

a

1 个答案:

答案 0 :(得分:0)

您必须为uitextfield设置目标rect并将帧的superview设置为给定代码,试试这个

UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setMenuItems:[NSArray arrayWithObjects:@"Paste", nil]];
[menu setTargetRect:textfield.frame inView:self.view];
[menu setMenuVisible:YES animated:YES]; 

可能对你有帮助。