我试图区分一个按钮,以便客户可以看到它是页面加载时默认处于焦点的按钮。该设计要求按钮周围有一个简单的边框。我button和button1我的CSS定义如下所示:
.button {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #003366
}
.button1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #003366
border: #00ffff;
border-style: solid;
border-width: 2px;
}
Run Code Online (Sandbox Code Playgroud)
我试图聚焦的按钮丢失了默认格式。我该如何解决这个问题,以便它只是保持其格式,唯一的区别是按钮周围的边框较粗?另外,有没有办法让边框简单地环绕按钮的形状而不是矩形边框?
这是我的按钮外观的图像:

在这种情况下,我试图聚焦Jail Address按钮。
输入按钮的 html 如下所示:
<input type="reset" class="button" name="refresh" value="Refresh">
<input type="submit" class=button1 name="jail" value="Jail Address" onClick="action='JailAddresses.html'">
<input type="submit" class="button" name="submit" value="Submit" onClick="action='Administrative.html'">
<input type="submit" class="button" name="back" value="Back" onClick="action='Administrative.html'">
Run Code Online (Sandbox Code Playgroud) 当它是 ToolStripButton.click 事件时,我无法更改光标。
我有 2 个按钮,称为“Rechercher”。
编辑:只有按钮在工作。似乎 ToolStripButton 取消了我的光标......感谢帮助
Public Class FenetrePrincipale
Private WithEvents _btnRechercher As New Windows.Forms.ToolStripButton("Rechercher")
Private WithEvents btnRechercherAccesBtn As New Button
Private Sub Rechercher(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _btnRechercher.Click, btnRechercherAccesBtn.Click
Try
Me.Cursor = Cursors.WaitCursor
'WAITING FOR THE CODE TO FINISH (2 sec)
Finally
Me.Cursor = Cursors.Default
End Try
End Sub
End Class
Run Code Online (Sandbox Code Playgroud) 按钮视图中的阴影属性为文本提供阴影。如何给Button的右边框和下边框加阴影? 如下图:
嘿,我想知道是否有任何方法可以做到这一点而不会疯狂地使用内置的 lil 按钮来制作它,但基本上我想做的是围绕一个圆形制作两个弯曲的按钮,有没有办法做到这一点?
她是我想要的一个例子,对不起,这幅画有多粗糙。

我想为我的生成水平文本颜色渐变AppCompatButton。我能够通过完成垂直文本颜色渐变
val signInBtn = view.findViewById<AppCompatButton>(R.id.btn_sign_in)
val textShader = LinearGradient(0f, 0f, 0f, signInBtn.textSize,
ContextCompat.getColor(context, R.color.gradient_start),
ContextCompat.getColor(context, R.color.gradient_end), TileMode.CLAMP)
signInBtn.paint.shader = textShader
Run Code Online (Sandbox Code Playgroud)
我曾尝试更改x2值,但似乎无济于事。任何帮助,将不胜感激。
这是我的按钮xml布局
<android.support.v7.widget.AppCompatButton
android:id="@+id/btn_sign_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/big"
android:layout_marginStart="@dimen/big"
android:layout_marginTop="@dimen/big"
android:background="@color/white"
android:text="@string/sign_in"
android:textAllCaps="false"
android:fadingEdge="horizontal"
android:scrollHorizontally="true"
android:textColor="@color/white"/>
Run Code Online (Sandbox Code Playgroud) 晚上,我正试图通过按钮操作打开Mail应用程序的收件箱邮件...
在网络上,我看到有可能打开EmailComposer对象的电子邮件应用程序..但我不是要发新电子邮件,我只是想让用户检查电子邮件.
有小费吗?
我在iOS中点击表单按钮后面临着CSS悬停样式问题.表单有一些输入字段,提交按钮具有在焦点和悬停状态下定义的类.问题是当表单有任何无效选择并单击提交按钮时.在移动设备中,以某种方式提交按钮的焦点被锁定并且在焦点和悬停状态中定义的样式被应用.可以使用Chrome响应模式检查并选择iphone6作为设备.
在桌面上,此问题不会发生; 点击之前和之后的按钮样式是相同的,但在移动设备中它是不同的.
.btnsubmit {
background-color: #000000;
border: 1px solid #000000;
color: #ffffff;
}
.btnsubmit:focus,
.btnsubmit:hover {
background-color: #ffffff;
color: #000000;
}
Run Code Online (Sandbox Code Playgroud)
将我的活动的父级更改Activity为AppCompatActivity,更改按钮上的字体.例如,Remove- > REMOVE.对于其他Vews,字体没有改变.
为什么按钮上的字体会发生变化?如何恢复原始字体?
按钮:
<Button
android:id="@+id/buttonAddProduct"
tools:text="Remove"
android:layout_width="match_parent"
android:textSize="13dp"
android:layout_weight="1"
style="@style/btns_blue_big" />
Run Code Online (Sandbox Code Playgroud)
样式:
<style name="btns_text_big">
<item name="android:textSize">@dimen/text_size_big</item>
<item name="android:textColor">@color/colorMainWhite</item>
</style>
<style name="btns_lo_big" parent="btns_text_big">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">48dp</item>
</style>
<style name="btns_blue_big" parent="btns_lo_big">
<item name="android:background">@drawable/button_dialog_positive_shape</item>
</style>
Run Code Online (Sandbox Code Playgroud) 我试图切换凸起按钮的颜色.最初按钮应为蓝色,按下时按钮变为灰色.现在我有一个名为pressAttention的bool值,它被设置为false.我用这个来初步设置这个假.按下按钮时,它会切换pressAttention bool,但似乎小部件永远不会再次更新.
new RaisedButton(
child: new Text("Attention"),
textColor: Colors.white,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)),
color: pressAttention?Colors.grey:Colors.blue,
onPressed: () => doSomething("Attention"),
)
void doSomething(String buttonName){
if(buttonName == "Attention"){
if(pressAttention = false){
pressAttention = true;
} else {
pressAttention = false;
}
}
Run Code Online (Sandbox Code Playgroud)
}
我有一个包含2个元素的回收器视图。我想添加2个按钮以执行不同的操作(取决于回收器视图的哪个元素。如何做到这一点?我的元素是textviews
SettingsActiv.kt
class SettingsActiv : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
val arrow_backBtn = findViewById(R.id.settingsToolbarBtn) as Button
arrow_backBtn.setOnClickListener{
startActivity(Intent(this, MainActivity::class.java))
}
val linearLayout = findViewById(R.id.constr) as LinearLayout
val recyclerView = RecyclerView(this)
val series = ArrayList<SeriesModel>()
recyclerView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
series.add(SeriesModel("Unit of length","Meter"))
series.add(SeriesModel("Unit of temperature","Celcius"))
val adapter = MyAdapter(series)
recyclerView.setHasFixedSize(true)
recyclerView.layoutManager = LinearLayoutManager(this, LinearLayout.VERTICAL, false)
recyclerView.adapter = adapter
linearLayout.addView(recyclerView,1)
}
Run Code Online (Sandbox Code Playgroud)
MyAdapter.kt
class MyAdapter(private val seriesList: ArrayList<SeriesModel>) : RecyclerView.Adapter<MyAdapter.MyViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyAdapter.MyViewHolder { …Run Code Online (Sandbox Code Playgroud)