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

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.

相关问答

更多
  • 首先,您需要对数据进行密度估算。 根据您选择的方法,可以获得不同的结果 。 假设你想要进行高斯密度估计 ,基于scipy.stats.gaussian_kde的例子,你可以得到密度高度: def density_estimation(m1, m2): X, Y = np.mgrid[xmin:xmax:100j, ymin:ymax:100j] positions = np.vstack ...
  • 您可以使用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: plt.an ...
  • 您正在使用数据框图函数创建新图形。 您应该传递要绘制第二个图的轴。 一种方法是使用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'] ...
  • 我想你想做这样的事情: 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 markers ...
  • 您将图像视图添加到子图中 getPlotChildren().add(iv1); 您可能不需要在重写的layoutPlotChildren()方法中执行此操作:仅在构造函数中执行一次就足够了: class SuperScatterChart extends ScatterChart{ private final ImageView iv1 ; public SuperScatterChart(NumberAxis xAxis, NumberAxis yA ...
  • 结果有两个原因。 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 (2048 ...
  • 我没有成功改变系列顺序,导致分散数据出现在一行之后。 即使图例的顺序发生变化,绘图顺序似乎也不会受到影响。 为了使您的线显示在散点图数据的前面,您需要将线放在辅助轴上,然后确保辅助轴的最小/最大值与主轴相同。 如果您不想看到辅助轴,请将“标签位置”设置为“无”。 I have not had success with changing series order causing scatter data to appear behind a line. Even though the order of the ...
  • 使用renderer.path绘制一条线。 您可以在加载事件上绘制线条并在重绘事件上重绘它。 events: { load: function() { var point = this.series[0].points[0], { plotX: x, plotY: y } = point; point.path = this.renderer.path() .add(point.ser ...
  • 将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)) Pu ...
  • 你可以让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

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)