小编Hus*_*Rad的帖子

访问JTOKEN,json.net中的所有项目

我有一个像这样的json块:

{
    "ADDRESS_MAP":{

        "ADDRESS_LOCATION":{
            "type":"separator",
            "name":"Address",
            "value":"",
            "FieldID":40
        },
        "LOCATION":{
            "type":"locations",
            "name":"Location",
            "keyword":{
                "1":"LOCATION1"
            },
            "value":{
                "1":"United States"
            },
            "FieldID":41
        },
        "FLOOR_NUMBER":{
            "type":"number",
            "name":"Floor Number",
            "value":"0",
            "FieldID":55
        },
        "self":{
            "id":"2",
            "name":"Address Map"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

如何获取此令牌包含的所有关键项.例如,从上面的代码我想要"ADRESS_LOCATION","LOCATION","FLOOR_NUMBER"和"self".

谢谢

c# json json.net

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

Splash屏幕之前的黑屏出现在android中

我们知道,当应用程序做一些漫长的过程,比如从互联网上下载一些信息时,它可能会在加载应用程序之前显示启动画面,当应用程序完全加载时,它将显示主页面.在启动画面活动中,我们必须在线程中加载长进程,以避免在加载应用程序之前显示黑屏.我做了所有这些.但在显示应用程序之前还会出现黑屏.这是启动画面活动的onCreate方法:

    protected override void OnCreate (Bundle bundle)
    {
        try {
            base.OnCreate (bundle);
            //_dt = DateTime.Now.AddSeconds (_splashTime);
            SetContentView (Resource.Layout.Splash );
            FirstLoadPB= FindViewById <ProgressBar >(Resource .Id.FirstLoadPB );
            FirstLoadingInfo= FindViewById <TextView >(Resource .Id.FirstLoadInfo );
            LoadApplication ();

        } catch (System.Exception ex) {

            Common.HandleException (ex);
        }
    }
Run Code Online (Sandbox Code Playgroud)

这是LoadApplication方法的代码:

public void LoadApplication()
    {
        new System.Threading.Thread (new ThreadStart (() =>
                                                      {
        //Some Codes to load applications- Downloading from web and accessing the storage(Because was many codes - about 100 line- i was clear them.

        } …
Run Code Online (Sandbox Code Playgroud)

android splash-screen xamarin.android

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

检测到操作栏后退按钮的点击 - (单击操作栏后退按钮时OnOptionsItemSelected未调用)

我有一个包含a的操作栏searchview.当用户单击搜索按钮并折叠搜索视图时,操作栏会在左侧显示后退按钮.

在此输入图像描述

我们如何检测用户何时点击此后退按钮?

编辑

基于答案,我检查了我,OnOptionsItemSelected但它也没有打电话.这是我的代码OnOptionsItemSelected:

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    if (item != null && id == android.R.id.home) {
        if (mNavigationDrawerFragment.isDrawerOpen(Gravity.RIGHT)) {
            mNavigationDrawerFragment.closeDrawer(Gravity.RIGHT);
        } else {
            mNavigationDrawerFragment.openDrawer(Gravity.RIGHT);

        }
        return true;
    }
    if (id == R.id.action_search) {
        return true;
    }
    return …
Run Code Online (Sandbox Code Playgroud)

android optionmenu android-actionbar searchview

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

iTunes Connect未显示我上传的IPA

我想为我的iOS应用程序添加一个新版本.我在iTunes Connect中为我的应用程序创建了一个新版本选项卡,设置所需信息,保存它们.然后我去Xcode并进行存档,验证它和Appstore的按下提交.

几分钟后,该过程成功完成,但在iTunes Connect中没有出现构建,我无法"提交审核".在构建部分下,它一直说:"使用Xcode 5.1.1或更高版本或Application Loader 3.0或更高版本提交构建."

问题是什么?

xcode itunesconnect ios

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

_kCFStreamErrorCodeKey = -2102仅限某些ISP的wifi

我使用下面的代码将文件发送到服务器:

NSString *urlString = [NSString stringWithFormat:@"%@%@",[LIUtility sharedUtility].uploadConnectionURL,BR_SERVER_UPLOAD_ADDRESS_FILE];

self.request =[[NSMutableURLRequest alloc] init];
[self.request setURL:[NSURL URLWithString:urlString]];
[self.request setHTTPMethod:@"POST"];

PKMultipartInputStream *body = [[PKMultipartInputStream alloc] init];

NSString *requestString =[self getRequestStringForRange:range andExtension:fileName];
NSData *requestData = [requestString dataUsingEncoding:NSUTF8StringEncoding];

NSString *jsonLengthString = [NSString stringWithFormat:@"%04lu",(unsigned long)requestData.length];
NSData *jsonLengthData = [jsonLengthString dataUsingEncoding:NSUTF8StringEncoding];

[body addPartWithName:@"jsonLength" data:jsonLengthData];
[body addPartWithName:@"json" data:requestData];
[body addPartWithName:@"separator" string:@"\r\n"];
[body addPartWithName:@"fileData" filename:fileName stream:dataStream streamLength:streamSize];

[self.request setHTTPBodyStream:body];
[self.request setTimeoutInterval:60];
NSString *contentType = LI_CONNECTION_CONTENTTYPE;
[self.request addValue:contentType forHTTPHeaderField: @"Content-Type"];

self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self];
_responseData = [NSMutableData data];
[self.connection …
Run Code Online (Sandbox Code Playgroud)

post objective-c nsurlconnection ios

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

查找android studio生成的apk版本号和版本代码

我知道.apk文件是zip文件,当我们提取它们时,可以解析清单文件,以便找到有关应用程序的一些信息.对于像我这样的人来说,它会创建一个app-store非常有用.实际上至少我可以找到应用程序的版本名称和版本代码.

但是在android-studio中,当我们构建一个签名的apk时,版本名称和版本代码没有在清单文件中定义.我们应该在build.gradle 文件中定义它们.所以现在在我的app-store中,当用户上传文件时,如何查找版本代码和版本名称并检测与旧版本不同?

android packaging android-manifest apk android-studio

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

使用java nio socket时,"已建立的连接被主机中的软件中止"

我使用java nio套接字开发了一个java服务器.这是我的应用程序的代码:

public class EchoServer {

static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Main.class);

private static final int BUFFER_SIZE = 1024;

private final static int DEFAULT_PORT = 4664;

private InetAddress hostAddress = null;

private int port;

private String ipAddress = "my ip";
private Selector selector;

// The buffer into which we'll read data when it's available
private ByteBuffer readBuffer = ByteBuffer.allocate(BUFFER_SIZE);

int timestamp = 1;

HashMap<Integer, String> connectedClients = new HashMap<Integer, String>();
HashMap<String, Integer> clientIds= new HashMap<String,Integer>();
HashMap<String, String> messageToClients = …
Run Code Online (Sandbox Code Playgroud)

java sockets nio

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

向渐变添加百分比

我正在尝试使用xml渐变代码创建一个按钮.(因为我是新用户无法上传图片:()此图片的边缘有两种颜色和角落.开始渐变的颜色将从所有渐变长度的15%开始,结束颜色以75%结束渐变长度.我使用此代码创建两种颜色的渐变:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item  >
    <shape  android:shape="rectangle">
        <gradient
    android:angle="-45"
    android:startColor="#64bcfb"
    android:endColor="#2f8fd4"
     android:type="linear"/>

        <corners android:radius="10dp" />
    </shape>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

问题是我不知道如何添加渐变的起始百分比和结束百分比.我对此进行了一些搜索,并将其中的一些内容添加到:

两种颜色的带状背景?

按钮上的渐变和阴影

两者都有一些解决方案,但我不适合我.解决方案是创建一个有两种颜色的简单栏,但我想创建一个按钮,其边缘也有一些角.我也不能在我的应用程序中使用原始图像,因为我需要务实地更改其颜色.有任何机构对如何在渐变中添加百分比有所了解吗?

android gradient drawable

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

xcode在上传档案时坚持使用iTunes商店验证资产

我正在尝试将已存档的应用程序上传到AppStore,但xCode卡在上传阶段并显示以下消息:

verifying assets with the iTunes store...
Run Code Online (Sandbox Code Playgroud)

我在下面看到链接:

应用程序加载程序停留在"使用iTunes Store验证资产"阶段

使用Application Loader中的App Store验证资产

并重新启动xCode和我的Mac; 还更新了Mac但仍然存在问题.

有人有什么想法吗?

iphone xcode ios

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

防止iOS上的反射(objc/runtime)

我正在处理一个处理敏感数据的静态库.使用库的开发人员必须不能在库上使用反射.

在Android上,我们通过aar使用services 开发文件并运行service到单独的进程来解决问题;(当服务运行到另一个进程然后开发人员不能使用反射)但我想知道iOS中是否存在类似的东西?

我们可以将静态库执行到单独的进程中吗?如果没有,我们如何避免反思我们的静态库?

例如:

        MyTestObject *obj = [[[myTestView alloc] init ];

        //===========================================   

        Class clazz = [obj class];
        u_int count;
        Ivar* ivars = class_copyIvarList(clazz, &count);
        NSMutableArray* ivarArray = [NSMutableArray arrayWithCapacity:count];
        for (int i = 0; i < count ; i++)
        {
            const char* ivarName = ivar_getName(ivars[i]);
            [ivarArray addObject:[NSString  stringWithCString:ivarName encoding:NSUTF8StringEncoding]];
        }
        free(ivars);

        objc_property_t* properties = class_copyPropertyList(clazz, &count);
        NSMutableArray* propertyArray = [NSMutableArray arrayWithCapacity:count];
        for (int i = 0; i < count ; i++)
        {
            const …
Run Code Online (Sandbox Code Playgroud)

reflection xcode objective-c static-libraries ios

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