小编Nig*_*ury的帖子

ActionBarActivity - NoClassDefFoundError异常

已经看到:NoClassDefFoundError Android与ActionBarActivityActionBarActivity在手机上捕获错误

我想在我的项目中使用ActionBarCompact.我已经在我的项目中链接了android-support-v7项目及其jar,并检查了许多来源的步骤,但我仍然无法解决问题.

当我构建我的项目时,没有错误,但在运行时有异常.不知道为什么没有检测到课程.请告诉我有什么问题.谢谢.

码:

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.widget.ArrayAdapter;

public class mainMenu extends ActionBarActivity implements ActionBar.OnNavigationListener {

    ActionBar actionbar;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menutab);

        actionbar = getSupportActionBar();
        actionbar.setTitle("Menu");
        actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

        ArrayAdapter<CharSequence> mSpinnerAdapter = ArrayAdapter.createFromResource(this,R.array.menu_items, R.id.simpleText);
        actionbar.setListNavigationCallbacks(mSpinnerAdapter, this);
    }

    @Override
    public boolean onNavigationItemSelected(int arg0, long arg1)//item pos, itemid
    {
        switch (arg0) {
        case 0:
            System.out.println("selected: " + arg0);
            break;
        case 1:
            System.out.println("selected: " + arg0);
            break;
        case 2:
            System.out.println("selected: …
Run Code Online (Sandbox Code Playgroud)

android noclassdeffounderror buildpath android-actionbar-compat android-actionbaractivity

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

尝试分配给只读属性ECMAScript React Native

我试图为我声明的数组赋值Component.不幸的是,抛出异常.

TypeError: Attempted to assign to readonly property
Run Code Online (Sandbox Code Playgroud)

即使我删除strict模式,仍然会引发异常.可以请某人指导我如何使变量既可读又可写?谢谢..!

码:

class RootView extends Component {

  cachedData : []; //declared array here


//trying to assign dictionary in some function

someFunction(results) {

    this.cachedData[this.state.searchString.length - 1] = results;
    //exception raised here
}

}
Run Code Online (Sandbox Code Playgroud)

ecmascript-6 react-native

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

带有 CoordinatorLayout 的 NestedScrollView 中的 Recycler 视图

下面是代码片段,有人可以帮我吗?我的折叠工具栏根本没有折叠。预期行为是:当我向上滚动时,工具栏应该从168dp到折叠56dp。但它根本没有崩溃。提前致谢。

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/one_primaryColor"
    android:fitsSystemWindows="true">

    <android.support.design.widget.CollapsingToolbarLayout
        android:layout_width="match_parent"
        android:layout_height="168dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            app:layout_collapseMode="pin">

            <ImageView
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:contentDescription="@string/app_name"

            app:layout_collapseMode="parallax"
            android:src="@drawable/logo" />

        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
    <android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipe_refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <android.support.v7.widget.RecyclerView...
Run Code Online (Sandbox Code Playgroud)

android material-design android-toolbar android-collapsingtoolbarlayout

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

nscfstring text无法识别的选择器发送到实例

我试图找出前3个小时的这个错误.通过搜索,我已经知道这个错误与内存管理有关,但我没有弄清楚我做错了什么.

我已经宣布了这4个标签:

@interface InteractiveHistory : UITableViewController {
UILabel *date;
UILabel *startTime;
UILabel *cal;
UILabel *duration;
}
Run Code Online (Sandbox Code Playgroud)

然后创建属性并合成它们.在viewDidLoad中,我初始化了所有这样的:

date = [[UILabel alloc] init];
Run Code Online (Sandbox Code Playgroud)

我也在dealloc()方法中释放它们.

我想要做的是使用这4个标签在表格的单元格中写入一些文本.文本将取决于indexPath.

在cellForRowAtIndexPath方法中,只显示2个标签并指示错误行:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];

        NSLog(@"constructing cell");

        //set up labels text

        date = [NSString stringWithFormat:@"%@",[[int_data objectAtIndex:indexPath.row] objectForKey:@"Date"]];


 NSLog(@"%@",date.text); //App crashes at this line
       [date setTag:1];


        startTime = [NSString stringWithFormat:@"%@",[[int_data objectAtIndex:indexPath.row] objectForKey:@"Start …
Run Code Online (Sandbox Code Playgroud)

memory-management objective-c ios4

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

stringByReplacingOccurrencesOfString:不起作用

我希望我的输出为"23",但它仍显示"123".

NSString *valorTextField = [[NSString alloc] initWithFormat:@"123"];
    [valorTextField stringByReplacingOccurrencesOfString:@"1" withString:@""];
    NSLog(@"%@", valorTextField);
Run Code Online (Sandbox Code Playgroud)

nsstring ios

0
推荐指数
2
解决办法
3131
查看次数

从iTunes Connect Game Center删除成就

我首先想到在我的游戏应用程序的第一个版本中取得了一些成就.所以我在iTunes Connect中创建了一个用于测试.现在我不想为用户取得任何成就.我想删除它,但没有令人惊讶的删除选项.状态栏下的框为空.

在此输入图像描述

苹果doc: 在此输入图像描述

所以问题是什么时候可以删除成就?有什么限制?请有人告诉我如何从itunes connect游戏中心删除成就?谢谢.

itunesconnect achievements ios game-center

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

导入错误:没有名为rest_framework_mongoengine的模块

我已经使用 pip 安装了 DjangoRest 框架和 Mongo 引擎,包含rest_framework_mongoengineINSTALLED_APPS列表中。当我运行服务器时仍然抛出异常。

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py”,第 227 行,包装器 fn(*args, **kwargs)

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/core/management/commands/runserver.py”,第 117 行,inner_run autoreload.raise_last_exception()

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py”,第 250 行,在 raise_last_exception Six.reraise(*_exception) 中

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py”,第 227 行,包装器 fn(*args, **kwargs)

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/ init .py”,第 27 行,在 setup apps.populate(settings.INSTALLED_APPS) 中

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/apps/registry.py”,第 85 行,填充 app_config = AppConfig.create(entry)

文件“/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/apps/config.py”,第 94 行,在 create module = import_module(entry) 中

文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/ init .py”,第 37 行,在 import_module import (name)中

导入错误:没有名为rest_framework_mongoengine的模块

这是我的Settings.py

使用pip list命令,列出了以下软件包:

Django (1.11.2)
djangorestframework (3.6.3)
mongoadmin (0.2)
mongodbforms (0.3)
mongoengine (0.13.0)
pip …
Run Code Online (Sandbox Code Playgroud)

python django mongoengine django-rest-framework

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