小编col*_*ole的帖子

Gradle - 错误无法找到参数的方法实现()[com.android.support:appcompat-v7:26.0.0]

我试图在android studio中打开现有的android项目,并且gradle无法在没有错误的情况下构建应用程序

android studio继续抛出错误

Error:(74, 1) A problem occurred evaluating project ':app'.
> Could not find method implementation() for arguments 
[com.android.support:appcompat-v7:26.0.0] on object of type 
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Run Code Online (Sandbox Code Playgroud)

build.gradle中的我的代码这有助于理解我的问题我的依赖关系

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

// google & support
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:palette-v7:$supportVersion"
implementation "com.android.support:customtabs:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'

// utils
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.github.Commit451:bypasses:1.0.4'
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
implementation 'com.drewnoakes:metadata-extractor:2.9.1'
implementation "com.orhanobut:hawk:2.0.1"

}
Run Code Online (Sandbox Code Playgroud)

请帮忙解决问题

java android android-studio android-gradle-plugin

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

在UIWebView/WKWebView中将CSS插入到加载的HTML中

我成功地获取HTML内容并显示到我的UIWebView中.

但是想要通过添加外部CSS文件来自定义内容.我只能改变文字和字体的大小.我尝试了所有可能的解决方案来进行更改,但它不起作用 - 它没有显示任何变化.

以下是我的代码

HTMLNode* body = [parser body];
HTMLNode* mainContentNode = [body  findChildWithAttribute:@"id" matchingName:@"main_content" allowPartial:NO];
NSString *pageContent = [NSString stringWithFormat:@"%@%@", cssString, contentHtml];
        [webView loadHTMLString:pageContent baseURL:[NSURL URLWithString:@"http://www.example.org"]];

-(void)webViewDidFinishLoad:(UIWebView *)webView1{
    int fontSize = 50;
    NSString *font = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", fontSize];
    NSString *fontString = [[NSString alloc] initWithFormat:@"document.getElementById('body').style.fontFamily=\"helvetica\""];

    [webView1 stringByEvaluatingJavaScriptFromString:fontString];
    [webView1 stringByEvaluatingJavaScriptFromString:font];
}
Run Code Online (Sandbox Code Playgroud)

请帮助我在我的视图中获取css样式表.

objective-c uiwebview ios wkwebview

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

self?.performSegue 不显示导航栏

self?.performSegue(withIdentifier: "myview", sender: nil)
Run Code Online (Sandbox Code Playgroud)

即使我在故事板中使用推送,上面的代码也不显示导航栏。下面的代码显示了一个错误,即使存在具有正确名称的 segue

self?.navigationController?.performSegue(withIdentifier: "myview", sender: nil)
Run Code Online (Sandbox Code Playgroud)

错误

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“Receiver () 没有标识符为“myview”的 segue”

uinavigationbar storyboard ios swift

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

popToViewController 不工作,但 popViewController 工作

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to pop to a view controller that doesn't exist.'
Run Code Online (Sandbox Code Playgroud)

使用此代码时

self?.navigationController?.popToViewController(vc2, animated: true)
Run Code Online (Sandbox Code Playgroud)

但是当我尝试弹出它的工作原理时

self?.navigationController?.popViewController(animated: true)
Run Code Online (Sandbox Code Playgroud)

我正在推动这个 viewController 就像

navigationController?.pushViewController(vc2, animated: true)
Run Code Online (Sandbox Code Playgroud)

我不确定,推动观点意味着当我尝试做时popToViewController。它上面有一个视图。请帮忙

uiviewcontroller uinavigationcontroller ios swift

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

从 recyclerView 中选择 item 中的一个复选框并取消选择之前选择的复选框

我有带部分的回收者视图。该项目包括行和标题。我想选择带有复选框的一项,如果用户选择下一项,我想取消选择旧的一项(复选框)。我找不到任何地方可以实现此功能。

这是我的代码

recyclerView = (RecyclerView)findViewById(R.id.recyclerViewActivityExample);
    recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));

    list = new ArrayList<>();
    list.add(new AnimalObject("Cat","Mammals", false));
    list.add(new AnimalObject("Lion","Mammals", false));
    list.add(new AnimalObject("Dog","Mammals", false));
    list.add(new AnimalObject("Monkey","Mammals", false));
    list.add(new AnimalObject("Puma","Mammals", false));

    list.add(new AnimalObject("Albatross","Birds", false));
    list.add(new AnimalObject("Pigeon","Birds", false));

    list.add(new AnimalObject("Crabs","Aquatic Animals", false));
    list.add(new AnimalObject("Sharks","Aquatic Animals", false));

    MyAdapter myAdapter = new MyAdapter();


    sectionedRecyclerViewAdapter = new SectionedRecyclerViewAdapter(getApplicationContext(),
            R.layout.layout_list_section, R.id.textViewItemSection, myAdapter, this);
    sectionedRecyclerViewAdapter.setSections(list);

    recyclerView.setAdapter(sectionedRecyclerViewAdapter);

}





 //-------------------Adapter----------------------------
public class MyAdapter extends RecyclerView.Adapter<MyViewHolder> implements MyViewHolder.ViewHolderClickListener {

    @Override
    public int getItemCount() {
        return list.size();
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) …
Run Code Online (Sandbox Code Playgroud)

java android android-checkbox android-recyclerview

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

滚动时 UISwitch 正在改变其他单元格的状态

我的桌面视图看起来像这样

 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! Cell
    return cell
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 200
}
Run Code Online (Sandbox Code Playgroud)

我的 tableviewcell 看起来像这样

class Cell: UITableViewCell {

override func awakeFromNib() {
    super.awakeFromNib()
    // Initialization code
}

override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)

    // Configure the view for the selected state
}

}
Run Code Online (Sandbox Code Playgroud)

当我更改任何单元格上的开关状态并滚动时。另一个单元格的开关周期性地在其他单元格的滚动时改变状态。请帮忙

uiswitch 的布局

uitableview uiswitch ios swift

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

如何在xcode中打开现有的本地pod?

是否可以在xcode中打开本地pod.不是通过添加到Xcode项目然后编辑它?

我想在我的硬盘上打开现有的pod文件.

到目前为止,在终端1)尝试这样的cd我的目录pod文件是2)打开Podfile -a Xcode

它说xcode不支持在没有项目或工作空间的情况下打开文件夹

PS我的本地pod文件中有3个文件1)LICENSE.txt 1)mainfolder - 包含classes文件夹

下面的答案让我打开或创建一个空白的pod文件我的问题是本地pod文件没有.xcodeproj文件.只是swift和obj C文件.希望在xcode中打开它以便在pod中进行更改或者是不可能的?

随后链接我创建了pod - Create Pod

iphone xcode ios cocoapods

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