可能重复:
如何在HTML工具提示中使用回车符?
我想在几行中显示"title"属性工具提示,所以它看起来像这样:
Line 1
Line 2
Run Code Online (Sandbox Code Playgroud)
<div title="Line 1\nLine 2">Secret</div>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
那可能吗 ?
我有一个带title属性的anchor元素.我想隐藏在浏览器窗口中将鼠标悬停在其上时出现的弹出窗口.在我的情况下,不可能做这样的事情,
$("a").attr("title", "");
Run Code Online (Sandbox Code Playgroud)
由于jQuery Mobile,标题将在某些事件发生后重新出现(基本上每次重新绘制锚元素时).所以我希望通过CSS隐藏标题.
就像是:
a[title] {
display : none;
}
Run Code Online (Sandbox Code Playgroud)
不起作用,因为它隐藏了整个锚元素.我只想隐藏标题.这甚至可能吗?弹出窗口不应该显示.
library(ggplot2)
my_title = "This is a really long title of a plot that I want to nicely wrap \n and fit onto the plot without having to manually add the backslash n, but at the moment it does not"
r <- ggplot(data = cars, aes(x = speed, y = dist))
r + geom_smooth() + #(left)
opts(title = my_title)
Run Code Online (Sandbox Code Playgroud)
我可以设置绘图标题以包围并缩小文本以适应情节吗?
我不喜欢rails默认使用页面标题的方式(只使用控制器名称),所以我正在研究一种新的方式:
应用控制器:
def page_title
"Default Title Here"
end
Run Code Online (Sandbox Code Playgroud)
帖子控制器:
def page_title
"Awesome Posts"
end
Run Code Online (Sandbox Code Playgroud)
应用布局:
<title><%=controller.page_title%></title>
Run Code Online (Sandbox Code Playgroud)
它运行良好,因为如果我在当前使用的任何控制器中没有page_title方法,它将回退到应用程序控制器中的默认值.但是,如果在我的用户控制器中我希望它返回"注册"以进行"新"操作,但是可以退回到其他任何操作?有没有办法做到这一点?
其次,还有其他人有任何其他方式在rails中进行页面标题吗?
我可以更改我的UINavigationController的字体吗?- > 标题
有没有办法隐藏窗口标题,以便它不会以全屏模式显示(
getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN,
LayoutParams.FLAG_FULLSCREEN)
Run Code Online (Sandbox Code Playgroud)
)但随后会出现
getWindow().clearFlags(LayoutParams.FLAG_FULLSCREEN)
Run Code Online (Sandbox Code Playgroud)
?
requestWindowFeature(Window.FEATURE_NO_TITLE)
Run Code Online (Sandbox Code Playgroud)
当然不是一个选择,因为这不会让它回来.
在我的应用程序中,我希望导航栏显示标题和副标题.
在这种程度上,我将以下代码添加到我的视图控制器:
// Replace titleView
CGRect headerTitleSubtitleFrame = CGRectMake(0, 0, 200, 44);
UIView* _headerTitleSubtitleView = [[[UILabel alloc] initWithFrame:headerTitleSubtitleFrame] autorelease];
_headerTitleSubtitleView.backgroundColor = [UIColor clearColor];
_headerTitleSubtitleView.autoresizesSubviews = YES;
CGRect titleFrame = CGRectMake(0, 2, 200, 24);
UILabel *titleView = [[[UILabel alloc] initWithFrame:titleFrame] autorelease];
titleView.backgroundColor = [UIColor clearColor];
titleView.font = [UIFont boldSystemFontOfSize:20];
titleView.textAlignment = UITextAlignmentCenter;
titleView.textColor = [UIColor whiteColor];
titleView.shadowColor = [UIColor darkGrayColor];
titleView.shadowOffset = CGSizeMake(0, -1);
titleView.text = @"";
titleView.adjustsFontSizeToFitWidth = YES;
[_headerTitleSubtitleView addSubview:titleView];
CGRect subtitleFrame = CGRectMake(0, 24, 200, 44-24);
UILabel *subtitleView …Run Code Online (Sandbox Code Playgroud) iphone title subtitle uinavigationcontroller uinavigationitem
我正在寻找关于如何在由pandas df.hist()命令生成的直方图集合顶部显示标题的建议.例如,在下面的代码生成的直方图图块中,我想在图的顶部放置一个通用标题(例如"我的直方图图集"):
data = DataFrame(np.random.randn(500).reshape(100,5), columns=list('abcde'))
axes = data.hist(sharey=True, sharex=True)
Run Code Online (Sandbox Code Playgroud)
我已尝试在hist命令中使用title关键字(即title ='我的直方图图集'),但这不起作用.
以下代码通过向其中一个轴添加文本(在ipython笔记本中)可以正常工作,但有点像kludge.
axes[0,1].text(0.5, 1.4,'My collection of histogram plots', horizontalalignment='center',
verticalalignment='center', transform=axes[0,1].transAxes)
Run Code Online (Sandbox Code Playgroud)
有没有更好的办法?
到目前为止,我已将我的suptitles放在框架上方,如下所示:

如何从框架上方将框架移到框架中?
到目前为止,我有一个解决方案,只需打印文本并将其设置在正确的位置,计算xlim和ylim.然而,这是错误的,如果文本不同,它只是看起来很糟糕.有没有办法将suplabel设置到框架中?或者只是将文字放在框架下方并居中?如果我不需要知道框架内显示的数据,那将非常方便.
我想为ggvis情节添加一个标题.我无法在任何地方找到一个例子.与其他R图很简单,例如
library(ggplot2)
library(ggvis)
x <- 1:10
y <- x^2
df <- data.frame(x, y)
plot(x, y, main = "Plot Title") # Base R with title
ggplot(df, aes(x, y)) + geom_point() + ggtitle("Plot Title") # ggplot2 with title
df %>% ggvis(~x, ~y) %>% layer_points() # ggvis but no title??
Run Code Online (Sandbox Code Playgroud)
觉得我错过了一些明显的东西.任何帮助赞赏.