小编And*_*rin的帖子

如何从Swift中的字符串生成条形码?

我是一个新的iOS开发人员.我想知道如何在Swift中生成条形码.

我已经有了代码,有多个资源可以从哪里学习如何读取条形码,但我没有找到任何关于从字符串生成一个的讨论.

非常感谢!

PS我知道有一个类似的问题,但它适用于Objective-C.我不知道Obj-C,我发现很难从.NET中获取.

barcode core-image ios swift

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

ReferenceError:未定义localStorage

我正在尝试使用Angular和ASP.NET Core进行用户身份验证。

我正在跟踪在这里找到的教程:

https://fullstackmark.com/post/10/user-authentication-with-angular-and-asp-net-core

我按照所有步骤进行操作,没有错误。

该应用程序运行,但是当我转到“ / register”或“ / login”路由时,

NodeInvocationException: Uncaught (in promise): ReferenceError: localStorage is not defined
ReferenceError: localStorage is not defined
Run Code Online (Sandbox Code Playgroud)

使用它的服务是:

import { Injectable, Inject } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';

import { UserRegistration } from '../shared/models/user.registration.interface';
import { ConfigService } from '../shared/utils/config.service';

import { BaseService } from "./base.service";

import { Observable } from 'rxjs/Rx';
import { BehaviorSubject } from 'rxjs/Rx';

//import * as _ from 'lodash';

// Add the …
Run Code Online (Sandbox Code Playgroud)

angular

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

角度错误"没有提供者注入FeedToken ORIGIN_URL!"

我正在尝试按照教程制作具有ngx-translate功能的Angular应用程序.

我做了所有的步骤,但我得到错误:"例外:调用节点模块失败,错误:错误:没有提供者注入FeedToken ORIGIN_URL!出错(本机)",我不知道还有什么可以尝试.

我的app.module.ts

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { HttpModule, Http } from '@angular/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

import { AppComponent } from './components/app/app.component'
import { NavMenuComponent } from './components/navmenu/navmenu.component';
import { HomeComponent } from './components/home/home.component';
import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
import { CounterComponent } from './components/counter/counter.component';

import { InjectionToken } from '@angular/core';

import { ORIGIN_URL } from './constants/baseurl.constants'; …
Run Code Online (Sandbox Code Playgroud)

angular

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

如何在 .NET Core 中使用 Angular 4 在同一个提交中发布表单数据和文件

我正在尝试在供应商表中添加一个新条目。该表还有另一个与之链接的表,其中存储了与每个供应商的合同。所需的功能是以相同的形式提交新供应商和合同的数据,但我无法使其工作。

我可以通过以另一种形式单独上传文件来添加新供应商并在合同之后,但不能在同一个提交操作中。

我怎样才能做到这一点?

我的表格是这样的:

<form class="form-material m-t-40" enctype="multipart/form-data">

    <div class="form-group has-warning">
        <h4 class="entity-info"><label for="denumire" class="label-has-danger"> Denumire furnizor </label></h4>
        <input type="text" id="denumire" name="denumire" class="form-control" placeholder="Denumire" [(ngModel)]="furnizor.denumire" #denumire="ngModel">
    </div>
    <div class="form-group has-warning">
        <h4 class="entity-info"><label for="cod" class="label-has-danger"> Cod intern furnizor </label></h4>
        <input type="text" id="cod" name="cod" class="form-control" placeholder="Cod intern" [(ngModel)]="furnizor.cod" #cod="ngModel">
    </div>
    <div class="form-group has-warning">
        <h4 class="entity-info"><label for="cod" class="label-has-success"> Cod de inregistrare fiscala furnizor </label></h4>
        <input type="text" id="codIntern" name="codIntern" class="form-control" placeholder="Cod" [(ngModel)]="furnizor.codIntern" #codIntern="ngModel">
    </div>
    <div class="form-group has-warning">
        <h4 class="entity-info"><label for="adresa" class="label-has-success"> Adresa </label></h4>
        <input …
Run Code Online (Sandbox Code Playgroud)

c# angular angular4-forms

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

iOS应用程序崩溃,因为图像使用太多内存

我知道这是一个愚蠢的问题,但这是我第一个真正的应用程序,我必须要做,我没有人问,我查找了这个问题,没有发现其他类似的问题.

我的应用程序在真实设备上崩溃,毫无例外.我在模拟器中看到使用了太多内存,过了一段时间我得出的结论是我使用的图片都应该受到责备.

该应用程序以这种方式构建:它有8个viewControllers用于不同的东西:例如,它开始于一个让用户选择他/她将玩的头像,这里我有两张图片,接下来是一个viewController,显示该头像的统计数据,这是另一张图片,依此类推.问题是每张图片都使用40MB的RAM进行显示,所以当用户进入游戏所在的gameviewCOntroller时,应用程序会使用超过300MB的RAM.因此,在iPAD 2或iPhone 4等设备上崩溃,但在iphone 5上却没有崩溃.

我尝试从"images.xcassets"和".atlas"文件夹设置图像,但结果完全相同.图片的尺寸不超过1500x1999像素,它们是png格式.

另外,我看到如果应用程序直接启动到giveViewController它将使用180MB,所以另一个viewController保留在内存或类似的东西.我应该"清除"它们或类似的东西吗?

//-------update-------
Run Code Online (Sandbox Code Playgroud)

这是我从仪器得到的: 在此输入图像描述

ios swift

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

如何在Treeview C#WPF中插入子项

我想在之前添加的TreeViewItem中添加子项.像这样的代码的问题:

如何在WPF中的TreeView控件中插入子节点?

或者我尝试使用的许多其他变体,如:

for (int i = 1; i <= dataTreeview.Items.Count; i++)
        {
             TreeViewItem tempTVI = (TreeViewItem)dataTreeview.Items.GetItemAt(i); 
        }
Run Code Online (Sandbox Code Playgroud)

是我得到一个InvalidCastException异常,因为项目(在另一个stackoverflow问题中)或tempTVI是字符串而不是TreeViewItem

我不知道为什么会这样,我的想法也用完了.

如果它有助于我在预览中使用Visual Studio 2015社区.

谢谢您的帮助.

c# wpf treeview

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

标签 统计

angular ×3

c# ×2

ios ×2

swift ×2

angular4-forms ×1

barcode ×1

core-image ×1

treeview ×1

wpf ×1