您好我有一个应用程序,我可以触摸滚动浏览几个屏幕,如Android Homescreen应用程序.
我现在设法在每个页面上添加一个按钮,从此更改为新活动,但滚动是从左到右,我希望它在单击按钮时向下滚动,但我无法弄清楚如何做到这一点.
(这可能是一个非常棒的问题 - 抱歉.)
这是我的main.java文件
public class main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button onebutton = (Button)findViewById(R.id.soundsone);
onebutton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(main.this, series1button.class);
startActivity(i);
}
});
Button twobutton = (Button)findViewById(R.id.soundstwo);
twobutton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(main.this, series2button.class);
startActivity(i);
}
});
Button threebutton = (Button)findViewById(R.id.soundsthree);
threebutton.setOnClickListener(new OnClickListener() …Run Code Online (Sandbox Code Playgroud) 我已经描述了一个自定义的按钮栏这里.
现在,我想在第一个和第二个之间以及第二个和第三个按钮之间添加一个分隔符.我的按钮栏定义如下:
<LinearLayout
android:id="@+id/buttonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/buttonbarstyle"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/buttonBarImageButton1"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/copy"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
<ImageButton
android:id="@+id/buttonBarImageButton2"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/options"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
<ImageButton
android:id="@+id/buttonBarImageButton3"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/media_play"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
任务似乎很简单,但我找不到一个好方法.它应该在每个按钮之间有一个灰色的分隔符,所以它看起来有点像这样.
我相信这很简单,请指出我正确的方向.
任何人都可以告诉我为什么这个表单不会在IE7中提交?
<form id="orderform" name"orderForm" action="http://www.mydomain.com/secure/delivery-details.html" method="post">
<a id="add">+</a>
<table id="ordertable" width="533" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr class="titles">
<td style="width:100px">Code (e.g 66203)</td>
<td style="width:100px">Mtrs (e.g 10)</td>
<td style="width:100px">Order Line Ref.</td>
<td>Image</td>
</tr>
<tr class="item">
<td class="prodcode"><input type="text" name="prodcode[]" id="prodcode" class="trigger" /></td>
<td class="meterage"><input type="text" name="meterage[]" id="meterage" /></td>
<td class="orderlineref"><input type="text" name="orderlineref[]" id="orderlineref" /></td>
<td class="imgsample"></td>
</tr>
</tbody>
</table>
<button type="button" value="submit">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud) 我正在创建一个自定义按钮.我想在按钮上设置文本的位置.


但我无法在此背景按钮图像上设置文本的确切位置.请分享您的建议以解决此问题.
我已经按照Nettuts上的教程了解如何向TinyMCE添加自定义按钮(http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right-way/)
它工作得很好,所有,但我想添加许多按钮,我想知道是否有一个聪明的方法来做到这一点,而不必一遍又一遍地复制所有代码.
这是我用来添加按钮的代码:
add_shortcode("quote", "quote");
function quote( $atts, $content = null ) {
return '<div class="right text">"'.$content.'"</div>';
}
add_action('init', 'add_button');
function add_button() {
if ( current_user_can('edit_posts') && current_user_can('edit_pages') )
{
add_filter('mce_external_plugins', 'add_plugin');
add_filter('mce_buttons_3', 'register_button');
}
}
function register_button($buttons) {
array_push($buttons, "quote");
return $buttons;
}
function add_plugin($plugin_array) {
$plugin_array['quote'] = get_bloginfo('template_url').'/js/customcodes.js';
return $plugin_array;
}
Run Code Online (Sandbox Code Playgroud)
然后我使用以下代码创建customcodes.js文件:
(function() {
tinymce.create('tinymce.plugins.quote', {
init : function(ed, url) {
ed.addButton('quote', {
title : 'Add a Quote',
image : url+'/image.png',
onclick : function() {
ed.selection.setContent('[quote]' …Run Code Online (Sandbox Code Playgroud) 我的问题很简单,我正在尝试动态更改此按钮的宽度:
按钮>机器人:layout_height = "35dip" 机器人:背景= "@绘制/ buttonlesson" 机器人:文本= "3级[TAP HERE]" 机器人:的onClick = "MenuLI1L3" 机器人:layout_width = "300dp" 机器人:ID =" @ + ID/II3 "> /按钮"
这是我使用的代码:
<Button>
android:layout_height="35dip"
android:background="@drawable/buttonlesson"
android:text="Level 3 [TAP HERE]"
android:onClick="MenuLI1L3"
android:layout_width="300dp"
android:id="@+id/II3"
</Button>
Run Code Online (Sandbox Code Playgroud)
文字确实改变但不是宽度.声音就像有一个bug.右边有另一个按钮,当这个按钮缩小到10像素时,可以填补间隙,所以我也无法改变上面的Linearlayout.
任何解释和解决方案?它不应该工作吗?谢谢
在Android中,我可以通过执行以下操作设置要启用或禁用的按钮:
button.setEnabled(true); 要么 button.setEnabled(false);
如何检查按钮启用状态是真还是假?
我的页面提交按钮有以下代码:html标记是:
<td align="Right"><input type="submit" value="Add Driver" ></td>
Run Code Online (Sandbox Code Playgroud)
而jquery是:
$( "input[type=submit]" ).button().click(function( event ) {
event.preventDefault();
});
Run Code Online (Sandbox Code Playgroud)
如何在上面添加一个ui图标,特别是 ui-icon-circle-plus
我的情况是:我有一个具有禁用焦点的EditText字段.在EditText字段旁边,我有两个输入法按钮.所以我想点击第一个按钮:打开软键盘并编辑EditText字段中的文本.我尝试了很多方法:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(yourEditText, InputMethodManager.SHOW_IMPLICIT);
Run Code Online (Sandbox Code Playgroud)
并不适合我.打开软键盘的唯一方法是:
toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
但是没有办法从EditText字段编辑信息.
您可以建议我在单击按钮时打开键盘并编辑某些EditText的文本.非常感谢!
编辑:
因此,EditText无法成为默认值.当我单击键盘按钮 - 应该是可聚焦的,然后显示软键盘输入文本并出现在EditText中.插入的其他方法是不需要键盘的ABC按钮.它将像摩尔斯电码输入 - 触摸并按住ABC按钮:)我将尝试在我的情况下实施的建议示例.感谢你们 :)
