小编Mik*_*ike的帖子

如何在窗口小部件的右侧创建没有向下三角形的android微调器

我有一个屏幕,用户有很多项目要输入,因此屏幕空间非常宝贵.

我希望屏幕上的小部件外观(在用户按下它之前)类似于Spinner右侧的EditText或Spinner小部件的左侧部分(没有正常的向下三角形).然后,当用户按下小部件时,他/她将获得正常的微调器选择对话框.

是否有一些Spinner样式属性我可以更改以实现此目的?

我无法看到这样的代码.

谢谢

android spinner nine-patch android-layout

42
推荐指数
4
解决办法
5万
查看次数

自定义对话框上的按钮不响应单击事件

我创建了一个扩展Dialog的自定义对话框.对话框上的一个按钮是"OK"按钮,当完成在其他字段中输入信息时,用户应该按下该按钮.我无法让任何听众设置为触发该按钮.

public class HeightDialog extends Dialog {

   private Button okButton;

   …

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

      this.okButton = (Button)this.findViewById(R.id.userOkWithHeight);

      this.okButton.setOnClickListener(new android.view.View.OnClickListener() {
         public void onClick(View v) {
            // Does not fire
            HeightDialog.this.dismiss();
            return;
         }
      });

      this.okButton.setOnLongClickListener(new OnLongClickListener() {
         public boolean onLongClick(View v) {
            // Does not fire
            HeightDialog.this.dismiss();
            return true;
         }
      });

     this.okButton.setOnTouchListener(new OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
           // Does not fire
           HeightDialog.this.dismiss();
           return true;
        }
     });

   …
}
Run Code Online (Sandbox Code Playgroud)

我还尝试了一个实现,其中Dialog类实现了侦听器(http://www.androidcompetencycenter.com/2009/01/android-basics-dialogs-and-floating-activities/)而不是使用内部类(http:// about-android.blogspot.com/2010/02/create-custom-dialog.html):仍然没有运气.

public class …
Run Code Online (Sandbox Code Playgroud)

android

7
推荐指数
1
解决办法
1万
查看次数

UISearchBar的取消和清除按钮在iOS 7中不起作用

我有一个xCode项目,其中包含一个带有"搜索栏和搜索显示控制器"的表视图,以允许用户优化显示的项目列表.一般而言,遵循http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view中提供的指导.我最近下载了支持iOS 7的最新xCode(版本5.0(5A1413)),并且正在测试有关不同目标的应用程序.

在iOS 6目标(模拟器或真实设备)上运行此应用程序时,它按预期工作,这意味着按取消按钮将删除搜索栏并按清除按钮(小灰色x)清除已输入的所有搜索条件用户.但是当项目在iOS 7目标上运行时,clear和cancel按钮都不起作用.

searchBarCancelButtonClicked方法在这个项目中实现,我已经验证当目标运行iOS 7时它没有被调用.

- (void)searchBarCancelButtonClicked:(UISearchBar *)SearchBar
{
    NSLog(@"searchBarCancelButtonClicked called");

    self.searchBar.text = nil;

    …

    // Hide Search bar when cancelled
    [self hideSeachBar];

    [self.searchBar resignFirstResponder];

    …
    }
Run Code Online (Sandbox Code Playgroud)

我的表视图控制器设置为UISearchDisplayDelegate和UISearchBarDelegate.而且它似乎仍在作为searchBar:textDidChange:在iOS 6或7目标上调用.

@interface ItemViewController () <UISearchDisplayDelegate, UISearchBarDelegate>
…
@end
Run Code Online (Sandbox Code Playgroud)

我看不到与此或任何iOS 7更改资料相关的任何其他帖子(例如https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html#//apple_ref/doc/uid/TP40013174-CH8-SW1)提到了为支持iOS7而需要进行的任何重新编码.

有什么想法吗?谢谢

objective-c uisearchbar ios ios7

7
推荐指数
1
解决办法
1万
查看次数

运行机器人应用程序时,在手机上安装了多个应用程序图标

我正在开发一个带Eclipse的Android应用程序.每当我在手机或模拟器上运行应用程序时,设备上都会安装四个应用程序图标.我猜它与我的清单文件有关,它有三个活动(3个用于标签).

当我卸载应用程序时,所有图标都将从手机中删除.重新安装后,所有四个都显示备份.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.seebergers.navyprtcalculator"
      android:versionCode="1"
      android:versionName="1.0">
    <application 
        android:icon="@drawable/app_icon" 
        android:label="@string/app_name" 
        android:debuggable="true">
        <activity android:name=".NavyPRTCalculator" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       <activity android:name=".BcaActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".PrtActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".BcaTapeActivity" android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">        
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest> 
Run Code Online (Sandbox Code Playgroud)

思考?

android

2
推荐指数
1
解决办法
2456
查看次数