MFMessageComposeViewController显示消息体突出显示进行编辑(MFMessageComposeViewController show with message body highlighted for editing)

我们可以像这样创建和显示文本作曲家:

let controller = MFMessageComposeViewController()
controller.body = messageText
controller.recipients = numbers
controller.messageComposeDelegate = self
self.present(controller, animated: true, completion: nil)

是否有可能提供一个MFMessageComposeViewController与body突出显示,以便用户可以开始输入以输入新消息,如果他们不喜欢我们提供的默认消息?

我查看了文档,但没有找到任何选项。


We can create and show a text composer like so:

let controller = MFMessageComposeViewController()
controller.body = messageText
controller.recipients = numbers
controller.messageComposeDelegate = self
self.present(controller, animated: true, completion: nil)

Is it possible to present an MFMessageComposeViewController with body highlighted so that the user can just start typing to enter a new message if they do not like the default message we have provided?

I looked through the docs but did not find any options for this.


原文:https://stackoverflow.com/questions/41988788
2023-07-17 20:07

满意答案

您正在使用数据框图函数创建新图形。 您应该传递要绘制第二个图的轴。 一种方法是使用gca来获取当前轴。

以下应该工作(虽然没有测试):

plt.figure(figsize=(10,7))
img=imread('California.png')

plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latitude'].max()])
ax = plt.gca()
housing.plot(x='longitude', y='latitude', kind='scatter', alpha=0.4, 
         s= housing['population']/100, label='population', ax=ax,
         c= 'median_house_value', cmap=plt.get_cmap('jet'), colorbar=True, 
         zorder=5)
plt.legend()
plt.show()

编辑:使用imshowextent参数以及经度和纬度数据的最小值和最大值将正确缩放图像。


You are creating a new figure by using the dataframe plot function. You should pass the axes on which you want to draw your second plot. One way is to use gca to get the current axis.

The following should work (not tested though):

plt.figure(figsize=(10,7))
img=imread('California.png')

plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latitude'].max()])
ax = plt.gca()
housing.plot(x='longitude', y='latitude', kind='scatter', alpha=0.4, 
         s= housing['population']/100, label='population', ax=ax,
         c= 'median_house_value', cmap=plt.get_cmap('jet'), colorbar=True, 
         zorder=5)
plt.legend()
plt.show()

EDIT: using the extent parameter of imshow with the minimum and maximum values of your longitude and latitude data will scale the image correctly.

相关问答

更多

Pyplot Scatter to Contour plot(Pyplot Scatter to Contour plot)

首先,您需要对数据进行密度估算。 根据您选择的方法,可以获得不同的结果 。 假设你想要进行高斯密度估计 ,基于scipy.stats.gaussian_kde的例子,你可以得到密度高度: def density_estimation(m1, m2): X, Y = np.mgrid[xmin:xmax:100j, ymin:ymax:100j] positions = np.v...

散点图移动标签(Scatter plot move labels)

您可以使用xytext参数来调整文本位置: plt.annotate(text[i],xy=(x[i],y[i]),xytext=(x[i]+10,y[i]+10), ha='right') 在这里,我将10添加到您的xy位置。 欲了解更多,你可以查看这里的建议: https : //matplotlib.org/users/annotations_intro.html You can use the xytext parameter to adjust the text position: p...

在地图上叠加散点图(img)(Overlay scatter plot on map (img))

您正在使用数据框图函数创建新图形。 您应该传递要绘制第二个图的轴。 一种方法是使用gca来获取当前轴。 以下应该工作(虽然没有测试): plt.figure(figsize=(10,7)) img=imread('California.png') plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latit...

用散点图叠加直方图列(Overlay columns of histograms with scatter plots)

我想你想做这样的事情: w = .2 bins = np.linspace(-4, 4, 11, endpoint=True) fig, ax = plt.subplots() for j in range(1, 15): tt = randn(50) nn, _bins = np.histogram(tt, bins) # don't use scatter unless you need to change the size or color of the mark...

如何在图像上绘制散点图?(How to plot scatter plot on an image?)

您将图像视图添加到子图中 getPlotChildren().add(iv1); 您可能不需要在重写的layoutPlotChildren()方法中执行此操作:仅在构造函数中执行一次就足够了: class SuperScatterChart extends ScatterChart<Number, Number>{ private final ImageView iv1 ; public SuperScatterChart(NumberAxis xAxis, NumberAx...

使用散点图和世界地图图像在地图上显示流星撞击,宽高比问题(Using a scatter plot and world map image to display meteor impacts on a map, Aspect ratio problems)

结果有两个原因。 1 - imshow()函数逐个像素地绘制,因此我必须将x和y乘以各自的轴分辨率,即(2048 x 1025) 2 - 我也有经纬度困惑,结果是x和拉特是y So there are two reasons it turns out. 1 - The imshow() function plots pixel by pixel so I had to multiply the x an y by there respective axis resolutions namely (...

在Excel中标记的散点图上的直线散布(Straight lined scatter over marked scatter plot in Excel [closed])

我没有成功改变系列顺序,导致分散数据出现在一行之后。 即使图例的顺序发生变化,绘图顺序似乎也不会受到影响。 为了使您的线显示在散点图数据的前面,您需要将线放在辅助轴上,然后确保辅助轴的最小/最大值与主轴相同。 如果您不想看到辅助轴,请将“标签位置”设置为“无”。 I have not had success with changing series order causing scatter data to appear behind a line. Even though the order o...

如何使用Scatter Plot highchart绘制下图?(How to draw following graph using Scatter Plot highchart?)

使用renderer.path绘制一条线。 您可以在加载事件上绘制线条并在重绘事件上重绘它。 events: { load: function() { var point = this.series[0].points[0], { plotX: x, plotY: y } = point; point.path = this.renderer.path() .add(poin...

散点图和箱线图叠加(Scatter plot and boxplot overlay)

将color=放在geom_point()的aes()中,并将其从ggplot() aes()删除。 如果你把color=放在ggplot()那么它会影响所有的geoms。 你也可以考虑使用位置闪避来分离点数。 使用mtcars数据作为OP的示例未提供数据。 ggplot(mtcars,aes(factor(cyl),mpg))+geom_boxplot()+ geom_point(aes(color=factor(am)),position=position_dodge(width=0.5)...

在3D散点图下方叠加地图(Overlay a map below a 3D scatter plot)

你可以让Matlab用KML格式写出来在Google Earth中显示。 这里有一些关于在KML中绘制路径点的文档: 链接 You could have Matlab write this out in KML format to display in Google Earth. Here's some documentation on plotting points of a path in KML: link

相关文章

更多

Storm - Guaranteeing message processing

https://github.com/nathanmarz/storm/wiki/Guaranteei ...

提交表单,显示遮罩层的问题

最近初开始学习jquery,想尝试做一个效果,就是提交页面上的一个表单,点击提交按钮(submit类型 ...

solr4.7开发实践 2——高亮显示

第一种方式是solrj操作: publicSolrDocumentListquery(String ...

xhEditor利用prettify实现代码高亮显示

prettify是Google开发的一款轻量级的代码高亮显示插件,这款插件比起常用的SyntaxHig ...

Android EditText软键盘显示隐藏以及“监听”

一、写此文章的起因 本人在做类似于微信、易信等这样的聊天软件时,遇到了一个问题。聊天界面最下面一般类似 ...

android高仿微信UI点击头像显示大图片效果

用过微信的朋友朋友都见过微信中点击对方头像显示会加载大图,先贴两张图片说明下: 这种UI效果对用户的体 ...

Android编程之仿微信显示更多文字的View

微信朋友圈中,如果好友发表的文字过长,会自动收缩起来,底下有提示,当点击“显示更多”时才会展开。 首先 ...

Android编程之仿微信显示更多文字的View

微信朋友圈中,如果好友发表的文字过长,会自动收缩起来,底下有提示,当点击“显示更多”时才会展开。 首先 ...

Eclipse中Hadoop的DFS Location无法显示DFS下的文件 解决方法

问题如上图所示,前提是首先要将Hadoop正确安装,在命令行中可以运行例子程序,然后在eclipse中 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本