问题描述
我创建了如下所示的内容,红色视图是此行代码import cv2
import numpy as np
x_mouse,y_mouse = (None,None)
def draw_rectangle(event,x,y,flags,param):
global x_mouse,y_mouse
if event == cv2.EVENT_LBUTTONDOWN:
cv2.rectangle(img,pt1=(x,y),pt2=(x+10,y+10),color=(180,105,255),thickness=4)
cv2.imshow('my_drawing',img)
cv2.waitKey(0)
x_mouse,y_mouse = x,y
cv2.namedWindow(winname='my_drawing',flags=cv2.WINDOW_norMAL)
cv2.resizeWindow(winname='my_drawing',width=600,height=600)
cv2.setMouseCallback('my_drawing',draw_rectangle)
img = np.zeros((600,600,3),np.uint8)
while True:
cv2.imshow('my_drawing',img)
k = cv2.waitKey(10) & 0xFF
if k == 27:
break
elif k == ord('s'):
print("x,y = ({},{})".format(x_mouse,y_mouse))
cv2.destroyAllWindows()
创建的TabBarController
的子视图
当我尝试在红色视图中添加按钮时,它们不会响应我的轻按,而是后面的ViewController(带有tabBar.insertSubview(redView,aboveSubview: tabBar)
的那个)响应了我的手势
我已经在红色视图中设置了imageCollecitonView
。有什么想法吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)