小编use*_*477的帖子

tableRow中的EditText如何修复100%

我有一个带表和按钮的linearlayout,表有EditText和TextView,我的问题是EditText,太小了

  <LinearLayout
        android:orientation="vertical"
        android:layout_width="300dip"
        android:layout_height="350dip"
        android:background="@drawable/background_resto"
    >

        <LinearLayout               
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:gravity="center"
            >

        <TableLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            >
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity ="center"
            >
                <TextView
                    android:id="@+id/nameRegister"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:textColor="#000000"
                    android:text="Nombre"
                    android:layout_marginLeft="10dip" 
                    />
            </TableRow>

            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity ="center"   
            >

                <EditText
                    android:id="@+id/registerName"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:singleLine="true"
                    android:layout_marginLeft="10dip"
                    android:layout_marginRight="10dip" 
                    />
            </TableRow>


        </TableLayout>
             <Button
                android:id="@+id/butRegister"
                android:layout_height="35dip"
                android:layout_width="wrap_content"
                android:text="Enviar"
                />
        </LinearLayout>
        </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我想EditText修复第一个linearLayout的300dip,但我不明白,我该怎么办?

先感谢您

android android-layout

3
推荐指数
1
解决办法
1897
查看次数

didFinishLaunchingWithOptions未调用

我在启用推送通知时遇到问题.

使用此代码我尝试启用通知:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

    return YES;
}
Run Code Online (Sandbox Code Playgroud)

它不起作用,所以我在行中添加了一个断点

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
Run Code Online (Sandbox Code Playgroud)

但似乎这部分代码永远不会执行.

为什么这不起作用?

iphone push-notification xcode4

3
推荐指数
1
解决办法
3809
查看次数

为itunes创建geojson文件

我想在我的应用程序中添加路由应用程序覆盖文件,我创建了一个geojson文件:

{"type":
"MultiPolygon","coordinates":[
    [-1.897287,39.035986],
    [-1.862268,39.022384],
    [-1.841154,39.000643],
    [-1.831369,38.980829],
    [-1.862869,38.967084],
    [-1.887503,38.976226],
    [-1.899261,39.007379]
]
}
Run Code Online (Sandbox Code Playgroud)

但是我收到了一个错误:

JSON file you uploaded was invalid. Errors : Each set of coordinates provided must be valid : [Ljava.lang.Object;@7de9b790
Run Code Online (Sandbox Code Playgroud)

我的错是什么?

谢谢!

geojson ios6

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

"prefered_external"属性

我有我的Android应用程序开发,我生成的apk文件,它的工作完美,该应用程序安装在我的SD,但是,当我从市场安装它安装在手机中.

我有这个:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackage.myapp"
android:versionCode="2"
android:versionName="2.0"
android:installLocation="preferExternal" >

<uses-sdk android:minSdkVersion="7" />
Run Code Online (Sandbox Code Playgroud)

我需要更改minSdkVersion吗?或者向我的开发人员控制台添加一些东西?

先感谢您!

android google-play

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

我的UITableViewCell设置按钮

我在向我添加按钮时遇到问题UITableViewCell,单元格有两个UILabels和两个UIImageViews,有时UIImageView会包含一个图像,有时会包含一个按钮:

在此输入图像描述

在我的UITableViewCell子类中,我有:

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if ( self ) {
        // Initialization code

    firstLock = [[UILabel alloc]init];
    [firstLock setBackgroundColor:[UIColor clearColor]];
    firstLock.textAlignment = UITextAlignmentLeft;
    firstLock.font = [UIFont fontWithName:@"Arial-BoldMT" size:17];

    secondLock= [[UILabel alloc]init];
    [secondLock setBackgroundColor:[UIColor clearColor]];
    secondLock.textAlignment = UITextAlignmentRight;
    secondLock.font = [UIFont fontWithName:@"Arial-BoldMT" size:17];

    firstLockImage = [[UIImageView alloc]init];

    secondLockImage = [[UIImageView alloc] init];

    [self.contentView addSubview:firstLock];
    [self.contentView addSubview:secondLock];
    [self.contentView addSubview:firstLockImage];
    [self.contentView addSubview:secondLockImage];
    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

当其中一个UIImageViews只是一个图像没问题,但是当我添加一个 …

objective-c uitableview

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

NotificationCompat.Builder通知问题

我正在尝试向我的应用添加通知.

API级别是8,所以,我需要使用NotificationCompat而不是Notification,不用我吗?

这是我的代码:

  NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
Run Code Online (Sandbox Code Playgroud)

但是,有一个错误,"不能作为一种类型解决"

哪里出错了

android android-notifications

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

JTabbedPane中的图标未显示

我的标签有问题:

JTabbedPane tab = new JTabbedPane();
    frame.add(tab, BorderLayout.CENTER);

    JPanel contact = new JPanel();
    contact.add(backgroundContact);
    tab.add("Contacto", contact);
    //tab.addTab("Contacto",new ImageIcon("images/image2.gif"), contact,"");

    JPanel schedule = new JPanel();
    schedule.add(backgroundSchedule);
    tab.add("Horario", schedule);
    //tab.addTab("Horario", new ImageIcon("images/image2.gif"), schedule,"");

    JPanel cost = new JPanel();
    cost.add(backgroundCost);
    tab.add("Tarifas", cost);
    //tab.addTab("Tarifas", new ImageIcon("images/image3.gif"), cost,"");


      // Los iconos
    tab.setIconAt(0, new ImageIcon("images/image1.gif"));
    tab.setIconAt(1, new ImageIcon("images/image2.gif"));
    tab.setIconAt(2, new ImageIcon("images/image3.gif"));
Run Code Online (Sandbox Code Playgroud)

我已经尝试了两个选项,但图标没有显示.为什么会这样?

我也试过:new ImageIcon("images/im.gif")哪个不存在,我没有任何错误

java swing image embedded-resource imageicon

0
推荐指数
1
解决办法
2335
查看次数

UIWebView,输入类型,如何添加百分比值

我有一个UIWebView,它有一个表,我想要它的UIWebView大小的80%,但在de NSString我用作html:

"<table width = \"80%\", align = \"center\">"
Run Code Online (Sandbox Code Playgroud)

我有一个警告:

Invalid conversion specifier '"'**
Run Code Online (Sandbox Code Playgroud)

因为它正在等待广告或@或其他什么.

我尝试使用NSLog查看html,并且缺少%

<table width = "80", align = "center">
Run Code Online (Sandbox Code Playgroud)

如何告诉NSString%值?先感谢您

objective-c nsstring

0
推荐指数
1
解决办法
358
查看次数

iTunesconnect,App Review联系信息

我在使用itunes connect时遇到了麻烦.

我想为我的应用添加一个新版本,但我收到了消息

The following error(s) occurred:

You must provide all required contact information. To edit your contact details, click Edit in the App Review section.
Run Code Online (Sandbox Code Playgroud)

但是,我找不到我应该在哪里添加信息!它在哪里?

itunesconnect ios6

0
推荐指数
1
解决办法
2317
查看次数

NSArray和NSDictionary

我有一个NSDictionary,我必须将它添加到NSArray.我该怎么做?

NSDictionary *row = [NSDictionary dictionaryWithObjectsAndKeys:
     [NSString stringWithFormat:@"%@",NSLocalizedString(@"no_favorites", nil)], @"Address", nil];
Run Code Online (Sandbox Code Playgroud)

如果我使用:

    aFavorite = [row allValues];
Run Code Online (Sandbox Code Playgroud)

如果我被打印了,我得到了:

(
"No favorites added"
)
Run Code Online (Sandbox Code Playgroud)

我需要的是:

  (
    {
    Address = "No favorites added";
 }
 )
Run Code Online (Sandbox Code Playgroud)

因为我会用:

NSDictionary* dict = [aFavorite objectAtIndex:[indexPath row]];
 NSString *contentForThisRow = [dict objectForKey:@"Address"];
Run Code Online (Sandbox Code Playgroud)

dict值可以有1或2个键.

objective-c nsdictionary nsarray

0
推荐指数
1
解决办法
5586
查看次数

nsstring和nsinteger转换

我有两个数组,第一个是内容编号,第二个使用这个数字作为索引.

NSArray *dayOfWeek = [NSArray arrayWithObjects:@"D",@"L",@"M", @"X",@"J",@"V",@"S", nil];

NSArray *arrayDays = [days componentsSeparatedByString:@" "];     

 //arrayDays  2 3 4 5 6 

     NSString *daysPrint;

     for (NSString *theDay in arrayDays) {
         NSLog(@"string %@",theDay);
         NSInteger dayIndex = (NSInteger)theDay;
         NSLog(@"integer %d", dayIndex);
         daysPrint = [NSString stringWithFormat:@"%@ %@", daysPrint, [dayOfWeek objectAtIndex:dayIndex]];

     }
Run Code Online (Sandbox Code Playgroud)

在日志中:

2012-07-02 12:49:27.322 usualBike[1698:f803] string 2
2012-07-02 12:49:27.323 usualBike[1698:f803] integer 109471840
Run Code Online (Sandbox Code Playgroud)

显然,当我试图让dayOfWeek [109461840]崩溃时.

我怎么解决这个问题?

先感谢您

iphone objective-c

-1
推荐指数
1
解决办法
519
查看次数