Tag: 后退button

如何以编程方式将button逐个添加到布局中?

如何在几行中逐一创buildbutton列表? 我做的: LinearLayout layout = (LinearLayout) findViewById(R.id.linear_layout_tags); for (int i = 1; i < 10; i++) { Button btnTag = new Button(this); btnTag.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); btnTag.setText("Button " + i); btnTag.setId(i); layout.addView(btnTag); ((Button) findViewById(i)).setOnClickListener(this); } 只有一行: 如何以编程方式进入下一行?

将参数附加到Swift中的button.addTarget动作

我想传递一个额外的参数到buttonClicked操作,但不能算出什么语法应在Swift中。 button.addTarget(self, action: "buttonClicked:", forControlEvents: UIControlEvents.TouchUpInside) 任何我buttonClicked方法: func buttonClicked(sender:UIButton) { println("hello") } 任何任何想法? 谢谢你的帮助。

如何使HTMLbutton不能重新加载页面

我有一个button( <input type="submit"> )。 当它被点击时,页面重新加载。 由于我有一些jQuery hide()函数在页面加载时被调用,这导致这些元素被再次隐藏。 我该如何让button什么都不做,所以我仍然可以添加一些button被点击但不重新加载页面的动作。

组中的哪个单选button被选中?

使用WinForms; 有没有更好的方法来find一个组的选中的RadioButton? 在我看来,下面的代码不应该是必要的。 当你检查一个不同的RadioButton,那么它知道哪一个取消选中…所以它应该知道检查哪个。 如何在不做大量if语句(或开关)的情况下获取这些信息。 RadioButton rb = null; if (m_RadioButton1.Checked == true) { rb = m_RadioButton1; } else if (m_RadioButton2.Checked == true) { rb = m_RadioButton2; } else if (m_RadioButton3.Checked == true) { rb = m_RadioButton3; }

ASP.NET身份validationlogin和使用浏览器后退button注销

我正在寻找一个解决scheme,用户使用浏览器的后退button导航到上一页登出。 我有一个Web应用程序在asp.net中构build,并使用自定义成员资格提供程序进行身份validation和授权。 一切正常,除非用户点击注销链接注销应用程序并redirect到默认封面,如果用户点击浏览器上的“后退”button,它实际上会返回到原来的位置,数据仍然会显示。 当然,他们不能在该页面上做任何事情,点击任何链接,他们将重新导向到login页面。 但是,这些信息显示正在让很多用户感到困惑。 我只是想知道是否有什么办法可以清除浏览器的历史,所以使用不能回去,或当他们点击后退button,并让他们redirect到login页面。 谢谢

选项卡上的索引

请参阅下面的表单HTML代码 <form method="post" action="register"> <div class="email"> Email <input type="text" tabindex="1" id="email" value="" name="email"> </div> </div> <div class="agreement"> <div tabindex="2" class="terms_radio"> <div onclick="changeTerm(this);" class="radio" id="terms_radio_wrapper" style="background-position: left 0pt;"> <input type="radio" id="terms" value="1" name="terms"><label for="terms">I have read and understood the</label> </div> </div> </div> <div class="form_submit"> <input type="button" tabindex="3" value="Cancel" name="cancel"> <input type="submit" tabindex="4" value="Submit" name="submit"> </div> </form> […]

如何使用JavaScript在Selenium WebDriver中单击一个元素

我有以下的HTML: <button name="btnG" class="gbqfb" aria-label="Google Search" id="gbqfb"><span class="gbqfi"></span></button> 我的下面的代码点击“Googlesearch”button在WebDriver中使用Java运行良好。 driver.findElement(By.id("gbqfb")).click(); 我想用WebDriver使用JavaScript来点击button。 我该怎么做?

jQuery $(“#radioButton”)。更改(…)在取消select期间不会触发

大约一个月前,米特的问题没有得到答复。 可悲的是,我现在正遇到同样的情况。 http://api.jquery.com/change/#comment-133939395 这是情况:我正在使用jQuery来捕获单选button中的更改。 当select单选button时,我启用编辑框。 当单选button被取消select时,我想要编辑框被禁用。 启用作品。 当我在组中select不同的单选button时, change事件不会被触发。 有谁知道如何解决这个问题? <input type="radio" id="r1" name="someRadioGroup"/> <script type="text/javascript"> $("#r1").change(function () { if ($("#r1").attr("checked")) { $('#r1edit:input').removeAttr('disabled'); } else { $('#r1edit:input').attr('disabled', true); } }); </script>

在android中定义button事件的最佳做法

我有一个由多个Button组成的XML定义的Layout 。 目前我在OnCreate方法中这样做来定义针对button的事件处理程序: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button newPicButton = (Button)findViewById(R.id.new_button); newPicButton.setOnClickListener(btnListener); ….. similarly for other buttons too ….. } 在Button的onClick事件中,我启动了一个相机Intent来获取图片,并在onActivityResultcallbackonActivityResult我再一次设置事件处理器,并设置View如下: protected void onActivityResult(int requestCode, int resultCode, Intent data) { setContentView(R.layout.main); Button newPicButton = (Button)findViewById(R.id.new_button); newPicButton.setOnClickListener(btnListener); …similarly for other buttons too } 我是Android新手,每次重新定义一个事件的方法对我来说似乎都很肮脏。 我想知道在像这样的场景中定义button事件处理程序的最佳做法是什么。 编辑:粘贴我的完整课程 public class CameraAppActivity extends Activity { /** […]

<input type ='submit'/>和<button type ='submit'> text </ button>之间的区别

他们有很多传说。 我想知道真相。 以下两个例子有什么区别? <input type='submit' value='text' /> <button type='submit'>text</button>