GVKun编程网logo

html – 将箭头选择器添加到按钮的中心(html箭头代码)

41

以上就是给各位分享html–将箭头选择器添加到按钮的中心,其中也会对html箭头代码进行解释,同时本文还将给你拓展23--html(css基础选择器3-id选择器)、android–将侦听器添加到数字

以上就是给各位分享html – 将箭头选择器添加到按钮的中心,其中也会对html箭头代码进行解释,同时本文还将给你拓展23--html(css基础选择器3-id选择器)、android – 将侦听器添加到数字选择器小部件、Android将图片添加到按钮、C#中当鼠标移动到按钮的时候按钮的右下角出现提示框?等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

html – 将箭头选择器添加到按钮的中心(html箭头代码)

html – 将箭头选择器添加到按钮的中心(html箭头代码)

我试图通过CSS添加一个白色箭头到链接按钮的底部.但是,我无法统一所有按钮的箭头中心..

JSFIDDLE

HTML:

<div>
    <a href="#">User information</a>
    <a href="#">Company information</a>
    <a href="#">Driver information</a>
</div>

CSS:

.help-buttons {
  margin: 75px auto;
  text-align: center;
}
.help-button {
  background: #1795db;
  color: #fff;
  padding: 15px 20px;
  font-family: 'Open sans';
  Box-shadow: 3px 3px 0px 0px rgba(0,0.2);
  margin: 0 30px;
}
.help-button:after {
  content: "";
  position: absolute;
  margin-top: 25px;
  margin-left: -75px;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 13px solid #ffffff;
}

解决方法

> Make .help-button position:relative;这样箭头就相对于按钮定位了.
>负边距:之后应与边框大小相同.
>调整底部:-6px以获得您想要的尺寸.

Have a fiddle!

HTML

<div>
        <a href="#">User information</a>
        <a href="#">Company information</a>
        <a href="#">Driver information</a>
    </div>

CSS

.help-buttons {
    margin: 75px auto;
    text-align: center;
}
.help-button {
    background: #1795db;
    color: #fff;
    padding: 15px 20px;
    font-family: 'Open sans';
    Box-shadow: 3px 3px 0px 0px rgba(0,0.2);
    margin: 0 30px;
    position: relative;
}
.help-button:after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    margin-left: -13px;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-bottom: 13px solid #ffffff;
}

23--html(css基础选择器3-id选择器)

23--html(css基础选择器3-id选择器)

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

android – 将侦听器添加到数字选择器小部件

android – 将侦听器添加到数字选择器小部件

我正在努力将数字选择器集成到我的应用程序中.活动显示每个带有数字选择器的项目列表.用户可以使用数字选择器增加或减少数量.当他们这样做时,我想更新显示价格的TextView.

我试图实现这一目标时遇到了困难.我做了一个简单的项目,并试图在用户点击小部件时尝试显示一个Toast消息,但无济于事.

我的猜测是,数字窗口小部件不被视为按钮,因此点击监听器不起作用?我很感激有关添加监听器的任何建议.

以下是我的代码:

NumberPicker np;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    np = (NumberPicker)findViewById(R.id.numberPicker1);
    np.setMaxValue(99);
    np.setMinValue(0);
    np.setValue(50);

    np.setonClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(v.getContext(),"Number selected",Toast.LENGTH_SHORT).show();
        }
    });
}

解决方法

要使用Picker设置侦听器,您的活动必须实现选择器接口侦听器. (实际上,您的活动不是强制实现界面,您也可以使用匿名内部方法.无论什么有效.)

所以在你的活动中:

public class MainActivity extends Activity implements NumberPicker.OnValuechangelistener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        NumberPicker np = (NumberPicker)findViewById(R.id.numberPicker1);
        np.setMaxValue(99);
        np.setMinValue(0);
        np.setValue(50);
        np.setonValueChangedListener(this);

    }

    public void onValueChange(NumberPicker picker,int oldVal,int newVal) {
        Toast.makeText(this,"change",Toast.LENGTH_SHORT).show();
    }
}

Android将图片添加到按钮

Android将图片添加到按钮

我想添加一个图像到一个按钮(没有图像按钮,因为特定按钮可以包含文本或图像;加上图像按钮有同样的问题),同时仍然保留原始的安卓风格的按钮.所以添加 android:在 XML中的背景不会削减它,因为这将删除android的默认按钮与圆角等(android.R.drawable.btn_default)

这是否有可能?

我认为一种方法是按下按钮的一个9patch图像(一个用于up和一个用于down),而onTouch Action_DOWN使得分层背景可以绘制并放在按钮上,并且做同样的事情,但是使用另一个9patch forTouch Action_UP,但我认为这将大大降低应用程序的性能,因为这将需要相当多的资源读取和层次合并所有的按钮点击(和我的应用程序,这将是相当多的).上面我说的正确吗

编辑:我不能在XML中声明图像的源,因为我从Web服务获取图像,所以任何东西都可以放在Buttons上,但它必须以编程方式进行.

解决方法

这可以使用你的layout.xml中的android:drawabletop,android:drawableBottom,android:drawableLeft,android:drawableRight属性来完成.

C#中当鼠标移动到按钮的时候按钮的右下角出现提示框?

C#中当鼠标移动到按钮的时候按钮的右下角出现提示框?

在Form中添加一个tooltip控件,这样在属性栏里就会多出一个tooltip属性,这样你就可以写上你要提示的话了

也可  
   
  <input   type="button"   name="button1"   id="button1"   value="按钮1号"   title="我是个按钮"   runat="server">  
   
  里面的title   就是了

关于html – 将箭头选择器添加到按钮的中心html箭头代码的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于23--html(css基础选择器3-id选择器)、android – 将侦听器添加到数字选择器小部件、Android将图片添加到按钮、C#中当鼠标移动到按钮的时候按钮的右下角出现提示框?等相关知识的信息别忘了在本站进行查找喔。

本文标签: