I found this page, which outlines how to change the rendering for a MenuStrip and its items.
I want to use this, but the problem is that the highlight color when you hover over a button doesn't match it.
Is there any way to change the highlight color from blue to yellow? I've tried using the MouseHover and MouseLeave events, but for some reason they're really slow, and they change the button to a solid color, which looks bad, …
我有一个 UISplitViewController,它的辅助(详细)VC 是一个 UICollectionViewController。我希望集合的单元格根据集合视图的大小和方面的变化来调整大小。我通过覆盖 UIContentContainer 协议方法触发此调整大小:
// MARK: - UIContentContainer protocol methods
override
func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator)
{
setFlowLayoutItemSizeForViewSize(size)
collectionViewLayout.invalidateLayout()
}
Run Code Online (Sandbox Code Playgroud)
当设备旋转时,这就是我想要的方式调用和工作;但是当 splitViewController?.displayModeButtonItem() 提供的按钮被按下以显示或折叠主(主)视图控制器时,不会调用此方法。由于折叠必然会更改辅助(详细信息)视图的大小,因此我认为应该在触发时调用 viewWillTransitionToSize... 方法。
所以,两个问题:
1) 实际上是否应该在按下 displayModeButtonItem 时调用 viewWillTransitionToSize... 方法?如果是这样,我似乎发现了一个错误。
2)如果我看到的实际上是正确的行为,任何人都可以建议我的辅助(详细)控制器“知道”什么时候按下 displayModeButtonItem 或者它的大小何时因该按钮而改变被压?
谢谢!
卡尔
button uisplitviewcontroller ios displaymode viewwilltransitiontosize
我们有一个 Android 应用程序,旨在安装在在崎岖地形中运行的车辆的仪表板上,所以一切都非常不稳定。我们发现在这种情况下在屏幕上点击一下是很困难的,因为点击通常被解释为小的拖拽。
我需要的是在手指出现之前有一点摆动的触摸事件被解释为点击,而不是拖动。我一直在阅读 Android 中“touch slop”的工作方式,我可以看到他们已经考虑到了这一点。我真正需要了解的是如何为 Androidbutton小部件的子类增加“触摸倾斜” 。
这可能只用几行代码吗?还是我需要自己实现onInterceptTouchEvent和“onTouchEvent”?如果是后者,谁能给我一些关于如何工作的指导?
我正在使用OpenCV开发一个游戏项目.现在我必须创建一个简单的GUI:一个带有一个按钮的窗口,仅使用HighGui.
我不确定,但我认为我应该使用这样的东西:
cvNamedWindow( "NameWindow" , CV_WINDOW_AUTOSIZE);
Run Code Online (Sandbox Code Playgroud)
任何帮助深表感谢.
我想在Android中有一个按钮边框颜色不同的按钮.
Button Bt = new Button(this);
Bt.setId(i+1);
Bt.setBackgroundColor(getResources().getColor(R.color.white)) ;
Bt.setText(restList.get(i));
Bt.setLayoutParams(params3);
Bt.setTextColor(Color.parseColor("gray"));
layout.addView(Bt);
Run Code Online (Sandbox Code Playgroud)
我该如何以编程方式执行此操作?
单击时,尝试使一个简单的按钮处于活动的不同样式.我正在使用HTML来布局按钮,CSS用于样式化,并希望使用一些JavaScript来实现.
在环顾四周并发现有许多不同的方法,例如使用Checkbox通过纯CSS或jQuery或JavaScript制作按钮,我觉得JavaScript是我所关注的最接近的方式.
HTML
<button type="button" class="btn" id="btn1">Details</button>
Run Code Online (Sandbox Code Playgroud)
CSS
.btn {
background: #3498db;
border-radius: 0px;
font-family: Arial;
color: #ffffff;
font-size: 12px;
padding: 2px 2px 2px 2px;
text-decoration: none;
height: 30px;
width: 70px;
margin-top: 5px;
margin-bottom: 5px;
display: block;
}
.btn:active {
background: #cecece;
text-decoration: none;
}
Run Code Online (Sandbox Code Playgroud)
JavaScript的
$('.btn').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active')
} else {
$(this).addClass('active')
}
});
Run Code Online (Sandbox Code Playgroud)
这是一个jsfiddle链接:http://jsfiddle.net/w5h6rffo/
附加说明
功能目标是让多个按钮具有相同的类,但每个按钮调用不同的功能.我调用了函数,只是按下第一次按下时按钮保持活动状态,然后再次按下时处于非活动状态
按钮大小应该通过在 VBox 中打包 HBox 来控制,但我的两个按钮仍然具有取决于文本的大小:
first=Gtk.VBox()
second=Gtk.HBox()
third=Gtk.VBox()
fourth=Gtk.HBox()
but1=Gtk.Button(label="any title")
first.pack_start(second,False,False,0)
third.pack_start(fourth,False,False,0)
first.pack_start(but1,False,False,0)
self.data_wp="title of label"
self.label_data=Gtk.Label(label=self.data_wp)
Gtk.Widget.set_size_request(but1,85,15)
but2=Gtk.Button(label=self.data_wp)
Gtk.Container.add(but2,self.label_data)
Gtk.Widget.set_size_request(but2,85,15)
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我从标签添加按钮标题,但这应该不是问题,我尝试直接在按钮上设置标题 - 没有任何改变。我尝试只使用一组 VBox,HBox,但也没有效果。
窗口上有一个按钮,窗口大小合适.我在按钮中放了一行,有一行和两列,并在第一列放置一个路径,在第二列放置一个文本框.
我的问题是我无法通过按钮拉伸网格.
以下是发生的事情:
这就是我想要发生的事情:
我有网格HorizontalAlignment ="Stretch",但它没有拉伸.我在这做错了什么?
这是代码:
<Window x:Class="GridInButtonIssue.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GridInButtonIssue"
mc:Ignorable="d"
Title="MainWindow" Height="136.5" Width="269.839">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="btn_SelectMode" Grid.Row="0" Margin="0,35,0,0" >
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*" />
<ColumnDefinition Width="4*" />
</Grid.ColumnDefinitions>
<Canvas x:Name="svg2" Grid.Column="0" Width="25" Height="25" HorizontalAlignment="Center">
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="0"/>
</Canvas.RenderTransform>
<Canvas x:Name="layer1">
<Canvas.RenderTransform>
<TranslateTransform X="-298.50531" Y="-576.33075"/>
</Canvas.RenderTransform>
<Ellipse xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Canvas.Left="298.6" Canvas.Top="576.4" Width="19.9" Height="19.9" x:Name="path4144" Fill="#FF951718" StrokeThickness="0.14452878" Stroke="#FFFD0000" StrokeMiterLimit="4" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" …Run Code Online (Sandbox Code Playgroud) 我正在使用语音识别应用程序,我想在录制时让我的播放/停止按钮"脉冲".像这样的东西:
我试图制作一个ScaleAnimation,按钮增长,但当然,它会使所有按钮增长.
public static ObjectAnimator pulseAnimation(ImageView target){
ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(target,
PropertyValuesHolder.ofFloat("scaleX", 1.1f),
PropertyValuesHolder.ofFloat("scaleY", 1.1f));
scaleDown.setDuration(310);
scaleDown.setRepeatCount(ObjectAnimator.INFINITE);
scaleDown.setRepeatMode(ObjectAnimator.REVERSE);
return scaleDown;
}
Run Code Online (Sandbox Code Playgroud)
所以这个想法是实现类似的东西,但只是在实际按钮后面有一个alpha.我想知道是否可以使用alpha动画或其他东西在我的按钮后面添加第二个"Alpha Button"以使其增长并实现此效果.
android button scaletransform android-animation android-imageview
我想知道 Froala ( https://www.froala.com/wysiwyg-editor )的所有工具栏按钮的名称。我知道以下几个:
“撤消”、“重做”、“粗体”、“斜体”、“下划线”、“strikeThrough”、“selectAll”、“paragraphStyle”、“下标”、“上标”、“paragraphFormat”、“fontFamily”、“fontSize” ", "align", "formatOL", "formatUL", "outdent", "indent", "quote", "color", "emoticons", "insertTable", "createLink", "insertImage", "insertVideo", “插入文件”、“全屏”、“html”、“保存”
我至少想念插入水平线按钮。