小编She*_*lam的帖子

如何在通话期间将视图放在绿色栏下面?

如何在通话期间让我的视图显示在绿色栏下方?现在,我的应用程序在打电话时被绿色栏部分覆盖.

iphone cocoa-touch objective-c interface-builder uiview

11
推荐指数
3
解决办法
9854
查看次数

如何在布局的左右两侧放置textview?

我想在布局的右侧和布局的左侧放置一个textview,但是它们会彼此叠加在一起:

<LinearLayout
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent" android:orientation="horizontal">
        <TextView
            android:id="@+id/lefttext"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:text="Symbol"/>
       <TextView
            android:id="@+id/righttext"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:text="Price"/>
    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

layout android textview android-linearlayout

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

使用Comparators帮助比较float成员变量

我可以很好地比较字符串,但想知道如何对浮点数进行排名?

getChange()返回一个String.我希望能够降序排序.我怎样才能做到这一点?

更新:

package org.stocktwits.helper;

import java.util.Comparator;

import org.stocktwits.model.Quote;

public class ChangeComparator implements Comparator<Quote>
{
    public int compare(Quote o1, Quote o2) {
        float change1 = Float.valueOf(o1.getChange());
        float change2 = Float.valueOf(o2.getChange());

        if (change1 < change2) return -1;
        if (change1 == change2) return 0; // Fails on NaN however, not sure what you want
        if (change2 > change2) return 1;
    }
}
Run Code Online (Sandbox Code Playgroud)

我收到编译时错误:

This method must return a result of type int    ChangeComparator.java   
Run Code Online (Sandbox Code Playgroud)

java sorting arraylist comparable comparator

11
推荐指数
3
解决办法
2万
查看次数

在Eclipse中运行我签名的发布密钥库时出现问题

我无法在Eclipse中运行已签名的发布密钥库:

我收到错误:

Keystore was tampered with, or password was incorrect
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

这是错误: 替代文字

这是我成功签署密钥库: 替代文字

java eclipse android keystore keytool

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

如何获得UITableViewCell的rect大小?

如何获得UITableViewCell的rect大小?

我试图在每次用户点击一个单元格时显示一个弹出悬停,并希望弹出悬停以每个单元格为中心显示:

[replyPopover presentPopoverFromRect:CGRectMake(77, 25, 408, 68) 
                              inView:self.view 
            permittedArrowDirections:UIPopoverArrowDirectionDown 
                            animated:YES];
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c uitableview ipad

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

如何在用户单击另一个选项卡后删除UITabBar徽章?

我想在用户点击其他标签后立即删除徽章.我想做:

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];

    UITabBarItem *tbi = (UITabBarItem *)self.tabController.selectedViewController.tabBarItem;
    tbi.badgeValue = nil;
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

iphone cocoa-touch objective-c uitabbarcontroller uitabbar

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

问题解锁Windows 7 Home Premium中的程序集

尝试加载基本项目模板时出现以下错误:

Error 12 Could not load the assembly file://\\psf\home\documents\visual studio 2010\Projects\WindowsPhonePivotApplication1\WindowsPhonePivotApplication1\obj\Debug\WindowsPhonePivotApplication1.dll. This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information. WindowsPhonePivotApplication1

当我尝试修改DLL以取消阻止程序集时,我没有安全选项卡.有什么建议?

替代文字

visual-studio-2010 windows-7 windows-phone-7

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

是否有类似于Android的Three20 Project的库?

Three20项目非常适合使用通用库快速构建iPhone应用程序:

https://github.com/facebook/three20

Android有这样的东西吗?

java android three20

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

如何检查我的字符串是否包含JavaScript中的句点?

我希望能够检测字符串是否有.在其中并基于此返回true/false.

例如:

"myfile.doc" = TRUE
Run Code Online (Sandbox Code Playgroud)

"mydirectory" = FALSE;
Run Code Online (Sandbox Code Playgroud)

javascript regex string

10
推荐指数
2
解决办法
3万
查看次数

后退按钮没有出现在按下的UIViewController上

我有一个UITableViewController.当我点击一个单元格时,我想推送一个新视图.这工作正常,但新视图没有后退按钮.为什么是这样?

TableViewCode:

if([[NSUserDefaults standardUserDefaults] boolForKey:@"isLoggedIn"])
{
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    ProfileViewController* profileViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
    profileViewController.message = [NSDictionary dictionaryWithObjectsAndKeys:cell.textLabel.text, @"user_login", @"default", @"message_source", nil];
    switch(indexPath.row) {
        case kUsernameRow:                  
            [self.navigationController pushViewController:profileViewController animated:YES];
            [profileViewController release];
            break;
        case kAboutRow:                 
            break;
        case kTOSRow:                   
            break;
    }
}
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c uitableview uiviewcontroller ios

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