I have the following error when trying to run a project, but if I go in and clean the route even if it doesn't compose, I show you the images in case anyone has any ideas or has already happened to them.
Rogelio Sanchez's questions
I have the following custom class of a UIButton
, but adding it to a button in Xcode fails to make the changes reflect. Does anyone know what the problem is?
import UIKit
class BotonBordesRedondeados: UIButton {
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
/*override func draw(_ rect: CGRect) {
// Drawing code
setup()
}*/
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
func setup () {
self.layer.backgroundColor = ColorUtils.hexStringToUIColor(hex: "#6B00FF") as! CGColor
self.backgroundColor = ColorUtils.hexStringToUIColor(hex: "#6B00FF")
layer.borderColor = ColorUtils.hexStringToUIColor(hex: "#6B00FF").cgColor
layer.cornerRadius = 20
layer.borderWidth = 2.0
}
}
I have a problem I hope someone can help me.
I have several activities
MainActivity, Activity1, Activity2, Activity3
MainActivity let's say it's a list and activities 1 to 3 are forms, in activity3 when a save ends I need to return to the MainActivity, but if I use finish I only return to the previous one, I don't want to use startActivity because when they hit the button from the phone "return" would return to Activity3.
Thanks.
I have the following code and the color of the menu button is white but I want to change its color and what I have tried has not worked yet.
I'd appreciate your help.
func addSlideMenuButton(){
//let image = UIImage(named: "menu-button2.png")
let btnShowMenu = UIButton()
btnShowMenu.setImage(self.defaultMenuImage(), for: UIControlState())
btnShowMenu.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
btnShowMenu.addTarget(self, action: #selector(BaseViewController.onSlideMenuButtonPressed(_:)), for: UIControlEvents.touchUpInside)
btnShowMenu.setTitleColor(UIColor.blue, for: UIControlState())
btnShowMenu.tintColor = UIColor.blue
//btnShowMenu.setBackgroundImage(image, for: UIControlState())
let customBarItem = UIBarButtonItem(customView: btnShowMenu)
self.navigationItem.leftBarButtonItem = customBarItem
let back = UIBarButtonItem(title: "⏎", style: .plain, target: self, action: #selector(BaseViewController.backNavigationSim(_ :)))
self.navigationItem.rightBarButtonItem = back
}
I have had a problem, when I generate a signed apk for release and install it directly on the device, it does not connect me with the rest services of my server, but if I generate the signed apk in debug, it connects me without problems, and if it is installed in android studio i still have no problem, does anyone know anything about this?
My config file:
build.gradle
// Top-level build file where you can add configuration options
common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
//classpath 'com.google.gms:google-services:2.0.0'
//classpath 'com.google.gms:google-services:2.0.0-beta2'
//classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
//classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-
releases/raw/master/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
minSdkVersion = 14
targetSdkVersion = 23
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
lintAbortOnError = false
// QuickBlox SDK version
qbSdkVersion = '2.6.1'
versionName = "2.6.1"
testRunnerVersion = "0.4.1"
// Dependency versions
playServicesVersion = '8.4.0'
//playServicesVersion = '9.0.2'
supportV4Version = '23.1.1'
appcompatV7Version = '23.1.1'
recyclerviewV7Version = '23.2.1'
supportAnnotationsVersion = '23.1.1'
designVersion = '23.1.1'
uilVersion = '1.9.0'
glideVersion = '3.6.1'
pullToRefreshVersion = '3.2.3'
stickyListHeaders = '2.7.0'
robotoTextViewVersion = '2.4.3'
stickersVersion = '0.7.3'
crashlyticsVersion = '2.2.2'
}
def makeJar(variant, project) {
//empty
}
module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
//buildToolsVersion "23.0.2"
defaultConfig {
applicationId "cibanco.com.mx.bcp"
minSdkVersion 14
targetSdkVersion 23
versionCode 9
versionName "3.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
flavorDimensions "tier"
productFlavors {
free {
dimension "tier"
}
full {
dimension "tier"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.google.android.gms:play-services:9.4.0'
//compile 'com.google.android.gms:play-services:9.2.1'
//compile 'com.google.android.gms:play-services-maps:9.4.0'
//compile 'com.google.firebase:firebase-ads:9.0.2'
//compile 'com.google.android.gms:play-services:9.0.2'
compile("com.quickblox:quickblox-android-sdk-core:$rootProject.qbSdkVersion")
compile("com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion")
compile("com.quickblox:quickblox-android-sdk-content:$rootProject.qbSdkVersion")
compile project(path: ':sample-core')
//compile "com.google.android.gms:play-services:${rootProject.playServicesVersion}"
compile "com.google.android.gms:play-services-maps:${rootProject.playServicesVersion}"
compile "com.google.android.gms:play-services-gcm:${rootProject.playServicesVersion}"
compile "com.github.bumptech.glide:glide:${rootProject.glideVersion}"
compile "se.emilsjolander:stickylistheaders:${rootProject.stickyListHeaders}"
//compile 'com.google.android.gms:play-services-maps:9.4.0'
//compile 'com.google.android.gms:play-services-gcm:9.4.0'
/*
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
*/
//compile 'com.google.android.gms:play-services-gcm:9.4.0'
//compile "me.leolin:ShortcutBadger:1.1.16@aar"
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.github.orangegangsters:swipy:1.2.2@aar'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
//apply plugin: 'com.google.gms.google-services'
build.gradle sample core
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildToolsVersion '26.0.2'
}
dependencies {
compile ("com.quickblox:quickblox-android-sdk-
messages:$rootProject.qbSdkVersion" )
compile "com.google.android.gms:play-services-gcm:${rootProject.playServicesVersion}"
compile "com.android.support:design:${rootProject.designVersion}"
compile "com.github.johnkil.android-
robototextview:robototextview:${rootProject.robotoTextViewVersion}"
}
manifest
<?xml version="1.0" encoding="utf-8"?>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<permission
android:name="android.permission.INTERACT_ACROSS_USERS_FULL"
android:protectionLevel="signature" />
<permission
android:name="cibanco.com.mx.bcp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="cibanco.com.mx.bcp.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="com.quickblox.sample.chat.App"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!-- <uses-library android:name="com.google.android.maps" /> -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="editada" />
-->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="editada" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".activity.LoginActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" />
<activity
android:name=".activity.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.OlvidoPass"
android:screenOrientation="portrait" />
<activity
android:name=".activity.EstadoOperacionActivity"
android:label="@string/title_activity_estado_operacion"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.NotificacionesActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.LoginActivity"
android:label="@string/login_title"
android:screenOrientation="portrait" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.SelectUsersActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.DialogsActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.ChatActivity"
android:screenOrientation="portrait"
android:theme="@style/ChatActivityTheme"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.ChatInfoActivity"
android:label="@string/chat_info"
android:screenOrientation="portrait" />
<activity
android:name="com.quickblox.sample.chat.ui.activity.AttachmentImageActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Dark" />
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="cibanco.com.mx.bcp" />
</intent-filter>
</receiver>
<service
android:name="com.quickblox.sample.chat.gcm.GcmPushListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.quickblox.sample.chat.gcm.GcmPushInstanceIDService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<activity
android:name=".activity.RHMenuCapacitacion"
android:label="@string/title_activity_rhmenu_capacitacion"
android:theme="@style/AppTheme.NoActionBar" />
</application>
I have a template in Android, I have an image, a title and a listview but when I put a button below the listview it is hidden on the screen, I have to put it above the listview because if it is not hidden but I would like it to be below, that has happened to me regularly when I try to put components below a listview. I attach my code.
Thanks.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/tema_fondo">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/linearPadre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/tema_color_blanco_transparente"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="65dp"
android:src="@drawable/tema_icono_paso_3" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/idHeaderCobertura"
android:layout_width="match_parent"
android:layout_height="80dp"
android:src="@drawable/cobertura" />
<TextView
android:id="@+id/textAseguradora"
android:textAlignment="center"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity= "center"
android:layout_below="@+id/idHeaderCobertura"
android:textColor="@color/colorGreen"
android:text="Aseguradora"
android:ems="18"/>
<ListView
android:id="@+id/coberturas_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textAseguradora"
android:drawSelectorOnTop="true"
android:divider="@null"
tools:listitem="@layout/list_item_detalle_cobertura" />
<Button
android:text="Continuar"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@color/radio_button_azul"
android:gravity="center"
android:layout_below="@+id/coberturas_list"
android:layout_gravity="center"
android:textColor="@color/colorWhite"
android:id="@+id/btnContinuar" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
I still can't get a .gitignore file that can help my code versioned in git for an Android project, if I modify a class or something very simple, changes are made to unnecessary files such as tests.
I am attaching my .gitignore as well.
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries
# Keystore files
*.jks
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
Thanks.
I have had a problem with xcode 9
.
It turns out that I have a project in swift 3
, I have it on a mac and the xcode
one where it was created was around 6, but on the same mac it has been updated xcode
from the store until it reached 9, the problem is that now on a new mac it xcode
is installed from 0, it is not updated as usual but in xcode
which the project has just been installed when wanting to visualize storyboard
it slows down a lot and gets stuck, it does not let me see for example the view of half and half (View and Controller
), then when doing that I have to force stop xcode
, the curious thing is that with other projects that were started newer this does not happen and I have no idea what configuration to move, the differences that I see is that in the one xcode
of the previous mac although it has the 9 thesdk
it appears as 10.3 and in the new one it only leaves me 11, but in reality I don't know if it is that