我一直在尝试按照此问题中提供的指南在我的Android Studio项目中使用SlidingMenu库:
如何在Android Studio上导入slidemenu?
我已经能够获得所描述的文件结构并同步和构建项目而不会出错.然而,当我尝试将滑动菜单导入我的应用程序源文件时,我得到一个符号解决错误.
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; // Error message: Cannot resolve symbol 'SlidingMenu'
import com.jeremyfeinstein.slidingmenu.lib.BuildConfig;
Run Code Online (Sandbox Code Playgroud)
第二个导入是Android Studio建议的唯一导入,但在遵循给定路径时,我甚至无法在项目中找到BuildConfig文件.
我需要更改什么才能将所有类导入com.jeremyfeinstein.slidingmenu.lib到我自己的类中?
我的应用程序gradle文件如下所示:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.me.appname"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile project(':libraries:SlidingMenu')
}
Run Code Online (Sandbox Code Playgroud)
SlidingMenu gradle文件:
buildscript {
// define the repo which is …Run Code Online (Sandbox Code Playgroud) 所以,我的表视图显示图像.每个细胞基本上都是填满整个细胞的图像contentView.由于图像具有不同的宽高比,我需要我的单元格根据表格视图宽度和图像的纵横比调整其高度.我遵循了这个Ray Wenderlich教程但现在遇到了约束冲突.通过改变imageViews高度约束来调整图像的大小myImageViewHeight.constant = tableView.frame.width / aspectRatio
2016-06-16 13:56:25.823 MyApp[92709:5649464] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x7fbcdaf5c190 V:[UIImageView:0x7fbcdaf5c300(303)]>",
"<NSLayoutConstraint:0x7fbcdaf5b460 V:|-(0)-[UIImageView:0x7fbcdaf5c300] (Names: '|':UITableViewCellContentView:0x7fbcdaf52230 )>",
"<NSLayoutConstraint:0x7fbcdaf5b4b0 V:[UIImageView:0x7fbcdaf5c300]-(0)-| (Names: '|':UITableViewCellContentView:0x7fbcdaf52230 )>", …Run Code Online (Sandbox Code Playgroud)