对于我为Android操作系统创建的小部件,我希望用户首先从Spinner中选择某个选项.就像向主屏幕添加快捷方式一样.
这是可能的还是你必须开始一项活动?如果有可能,任何人都可以解释如何做到这一点?
客户要求将纺车作为其导航的一部分.用户面对车轮的边缘,其上有各种导航项目,他们通过鼠标的单击/拖动来旋转它.无论它停在什么位置,它们都呈现在哪个页面上.我能找到的唯一例子是帮助说明我想要的是在这个网站上.
我不知道从哪里开始这个效果.有没有人可以提供一些帮助.我不需要代码,因为我对ActionScript 3非常好,我只需要讨论一下如何做到这一点,因为我被困在这里.
干杯,
担
因此,我正在尝试编写一个包含两个微调器和一个按钮的活动,当选择了两个微调器并按下按钮时,它将带您进入另一个活动.除了一个组合,它应该产生一个Toast,说你不能这样做.
无论如何,这是代码:
public void onClick(View v) {
String spinnerchoice1 = ("spinner1Value");
String spinnerchoice2 = ("spinner2Value");
if((spinnerchoice1.equals("Walking")) && (spinnerchoice2.equals("Hiking"))){
Toast.makeText(getBaseContext(), "I'm sorry, this is not possible.", Toast.LENGTH_LONG).show();
}else{
Intent i = new Intent(GetDirections.this.getApplicationContext(), DirectionDisplay.class);
i.putExtra("spinner1Value", transportSpinner.getSelectedItem().toString());
i.putExtra("spinner2Value", locationSpinner.getSelectedItem().toString());
GetDirections.this.startActivity(i);
}
}
Run Code Online (Sandbox Code Playgroud)
谁能告诉我哪里出错了?
谢谢
我试图通过匹配一个名称但我无法完成从我的微调框视图中获取项目文本.这是我使用的代码:
for(int i=0;i<calendar_spinner.getAdapter().getCount();i++) {
String s= calendar_spinner.getAdapter().getItem(i).toString();
System.out.println("Calendars are"+s);
if(calendar_Name.equals(s))
{
System.out.println("Calendar setted");
calendar_spinner.setSelection(i);
break;
}
}
Run Code Online (Sandbox Code Playgroud)
我得到s的输出为com.android.calendermodel.MyCalendarsModel@405872a0不完全是名字,不同的东西......
如何仅使用Themes.xml从微调器BUTTON中删除单选按钮?我可以在应用其他样式后将其删除,但我默认情况下无法从Themes.xml中删除此单选按钮.
<style name="My.Theme.Spinner" parent="android:Widget.Spinner">
<item name="android:background">@drawable/spinner_bg</item>
<item name="android:clickable">true</item>
<item name="android:spinnerMode">dialog</item>
<item name="android:checkedButton">@null</item>
<item name="android:checkable">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)
主题
<style name="My.Theme" parent="@android:style/Theme">
<item name="android:spinnerStyle">@style/My.Theme.Spinner</item>
</style>
Run Code Online (Sandbox Code Playgroud)
ORIGINAL适配器(项目中带单选按钮)
new ArrayAdapter<String>(getActivity(), R.layout.spinner_item,
getResources().getStringArray(R.array.registrationIds));
Run Code Online (Sandbox Code Playgroud)
更新适配器(无收音机):
new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_spinner_item, getResources().getStringArray(R.array.registrationIds));
Run Code Online (Sandbox Code Playgroud)
注意:微调器项目应该有一个单选按钮.Spinner按钮应该没有收音机.
fragment.xml之
<Spinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/small_content_padding"/>
Run Code Online (Sandbox Code Playgroud)
看我的问题: 
我正在构建一个带有很多ajax调用的Web应用程序,100多个,我用来在我的Web应用程序中注入所有内容.
我希望找到一种隐藏页面并显示ajax微调器的方法,直到所有ajax调用完成...和/或整个应用程序已加载,然后显示该站点.
否则,用户可以导航A.可能无法完全正确呈现的页面,或者当网站在完全加载时刷新到Home时,将导航到中间导航.
我遇到了一个解决方案的胆量,但不知道如何实现.或者将两者放在一起...大学项目到目前为止还没有专业人士,但这看起来很有希望
$(document).ajaxStop(function () {
// $.active == 0
});
Run Code Online (Sandbox Code Playgroud)
$(document).ajaxStart(function() {
$.mobile.loading('show');
});
$(document).ajaxStop(function() {
$.mobile.loading('hide');
});
Run Code Online (Sandbox Code Playgroud)
我怎么能让这个工作?我的ajax调用是在许多.js文件中引用的(app的不同部分)
非常感谢任何帮助!
编辑:使用示例ajax调用
$.ajax(
{
url: "http://myurl",
type: 'get',
dataType: 'jsonp',
success: function(data)
{
if (data.result == 'success')
{
var previousPageID = "";
var currentPageID = "";
$.each(data.data, function(key, data) //scans through each Lv1 Category, creates a button and page and links thems.
{
var divLabel = data.label;
var pageID = currentPageID + data.label.replace(/\s/g, "");
$('#contentPage').append(generateButtons(pageID, divLabel)); //generates …Run Code Online (Sandbox Code Playgroud) 基本上我想要做的就是关闭Spinner的对话框和我在这些框外点击时创建的自定义对话框.谁知道如何处理这些?
dialog.xml,My Spinner的xml,MakeandShowDialogBox函数如下:
dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:id="@+id/scheduleTable"
android:layout_height="wrap_content"
android:layout_width="match_parent"
></TableLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
Spinner XML
<Spinner
android:id="@+id/spinList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/strDepartmentNames"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:spinnerMode="dialog"
android:paddingTop="15dp"
android:paddingBottom="15dp" />
Run Code Online (Sandbox Code Playgroud)
makeAndShowDialogBox
private void makeAndShowDialogBox() {
AlertDialog.Builder myDialogBox = new AlertDialog.Builder(this);
final LayoutInflater layoutInflater = (LayoutInflater) getApplicationContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View dialogView = layoutInflater.inflate(R.layout.dialog, null);
// Set three option buttons
myDialogBox.setPositiveButton("Close",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
myDialogBox.setView(dialogView);
myDialogBox.create();
myDialogBox.show();
}
Run Code Online (Sandbox Code Playgroud) 我正在使用我正在使用的演示应用程序Spinner并且具有类似黑色的背景颜色,因此Spinner选择的项目颜色默认为黑色,因此它不可见.
我希望通过xml或更新样式将此颜色更改为白色,以便它可以在黑色中显示.
<Spinner
android:id="@+id/countrySpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:hint="@string/country" />
Run Code Online (Sandbox Code Playgroud)

有什么办法吗?提前致谢.
我有一个Spinner s对象,我想用String数组初始化它,之后我想设置这个布局AlertDialog.Builder
btnImg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View view = getLayoutInflater().inflate(R.layout.sub_activity_menu_item_addcart, null);
Spinner s = (Spinner)view.findViewById(R.id.sub_activity_mene_item_addcart_quantity);
String[] items = new String[]{
"1", "2", "3", "4", "5",
"6", "7", "8", "9", "10",
"11", "12", "13", "14", "15",
"16", "17", "18", "19", "20",
};
/* HOW ? */
// s.setValues(items); ????
alertBox.setView(view);
alertBox.setTitle("Add to Cart")
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
alertBox.show();
}
});
Run Code Online (Sandbox Code Playgroud)
脚步
Layout …我做了一个alertDialog来获取用户的输入.在对话框中,我显示了一个微调器,让用户选择数据.我使用了这样简单的微调项目:
spinnerCategories.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, CategorieNames));
Run Code Online (Sandbox Code Playgroud)
这是图像:
单击微调器时,项看起来很小或很薄.它绝对不像这个微调器演示:
有谁知道如何获得示例结果?
谢谢