我想将文本设置为导航抽屉标题文本,我搜索了很多,但每个人都通过膨胀布局来实现它,但对我来说它创建了2个标题所以有没有办法设置它而不膨胀布局?
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
View header=navigationView. findViewById(R.id.header);
/*View view=navigationView.inflateHeaderView(R.layout.nav_header_main);*/
name = (TextView)header.findViewById(R.id.username);
email = (TextView)header.findViewById(R.id.email);
name.setText(personName);
email.setText(personEmail);`
Run Code Online (Sandbox Code Playgroud) 我正在使用zend框架和doctrine2.1进行开发.
我从数据库生成了实体.
但问题是:Doctrine无法识别我的索引.它们根本没有在实体注释中标记.
当我去验证模式并从中转储sql时orm:schema-tool:update --dump-sql
,生成sql以删除整个数据库中的所有索引.
我发现Doctrine有以下用于定义索引的注释:
indexes={@index(name="index_name",
columns={"database_column1","database_column2"}
)}
Run Code Online (Sandbox Code Playgroud)
但这允许我为多列定义一个索引,我真的不需要它.
我想要的是能够在多列上定义多个索引,每列一个索引.
有没有办法实现这个目标?有没有一种方法可以让我有一个定义多个索引的注释.
我正在尝试将espresso集成到我的ui测试应用程序中.这是我在Gradle中的依赖项
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.1'
compile 'com.github.bumptech.glide:okhttp-integration:1.3.1@aar'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:cardview-v7:21.+'
compile 'com.android.support:recyclerview-v7:21.+'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
compile 'com.android.support:support-annotations:22.2.0'
androidTestCompile 'com.android.support.test:runner:0.3'
compile project(':common')
compile project(':service')
}
Run Code Online (Sandbox Code Playgroud)
所以我的espresso依赖项都包括在内.但是,当我尝试构建时,我收到此错误:
Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.1) and test app (22.2.0) differ.
有没有遇到过这个?我发现它在这里报道但是没有解决方案.有人有解决方法吗?
我有一个带Devise的Rails 3项目,启用了确认,因此用户必须在注册后通过电子邮件确认他们的帐户.目前,该项目将用户返回到登录页面并抛出"您已成功注册..."通知.我想要做的是将它们重定向到"谢谢"页面,并提供进一步说明(检查您的电子邮件,垃圾邮件文件夹,等等).
我的第一站是Devise wiki,在那里我找到了这个页面.看起来很容易,我做了以下改动,并严格按照指示......
/app/controllers/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
protected
def after_sign_up_path_for(resource)
"http://google.com"
end
end
Run Code Online (Sandbox Code Playgroud)
/config/routes.rb
devise_for :users, :controllers => { :registrations => "registrations" }
Run Code Online (Sandbox Code Playgroud)
我必须在方向上进行的一项修改是将"registrations"文件夹移出/ app/views/devise视图文件夹并移至top/app/views文件夹,因为返回的错误现在缺少视图.无论如何,尽管控制器覆盖似乎工作(我不认为视图原本会打破其他方式),这些方向不起作用...页面忽略after_sign_up并在注册后返回登录页面.
在互联网上搜索包括其他Stack Overflow线程,但我发现的任何内容都没有对我有用...或者回答混淆重定向注册用于登录IN,或者他们实际做的是在登录后更改重定向(正如Devise通常注册后自动登录,不启用确认).
我试过的其他事情......
将after_sign_up_path_for(资源)移动到应用程序控制器中.不行.奇怪的是,对after_sign_in_path_for(资源)执行相同操作并以用户身份登录重定向.
将registrations_controller.rb从/ app/controllers /移动到/ app/controllers/users文件夹并相应地更新所有路由/引用/等.不行.
将Devise的registrations_controller.rb复制到我自己的registrations_controller.rb中.没有工作,只是抛出一个错误,我把它全部卷回来.
我尝试了def after_inactive_sign_up_path_for(资源),因为我认为这个帐户不活跃的事实可能是罪魁祸首.这也被忽略了.
值得一提的是,我已经尝试在这些重大更改后重新启动我的项目,但没有任何需要.
有没有人在启用确认功能的情况下取得成功?
给出一个字符串 "5 900 000"
我想gsub
用下面的模式去除空格:
gsub(/\s/, '')
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用.也不是:
gsub(' ', '')
Run Code Online (Sandbox Code Playgroud) 所以,我知道如何使用android的密码生成调试哈希密钥.我知道对于每个新设备,我需要生成(并上传到Facebook)新的哈希密钥.
现在,我还没准备好实际投入生产,但是我想将应用程序分发给一组不想自己生成哈希事物的测试人员.我看到对非调试哈希键的引用:
接下来,您需要为应用程序生成Key Hash.对于调试,如果使用Eclipse,则需要使用Android调试密钥生成此Key Hash.当您准备发布应用程序时,您需要为签名密钥生成密钥哈希值,并在签名的应用程序运行之前在Facebook中更新此值.
http://www.techrepublic.com/blog/app-builder/integrate-facebook-logins-in-your-android-app/296
你是如何产生的?我之前从未制作过制作(签名)的应用程序,这与此有关吗?在完成之前签署我的应用程序是否有缺点?如果不是,我该怎么做让任何设备运行这个应用程序与Facebook连接?
我使用的是rails_admin和paperclip,但是使用带有回形针属性的模型安装rails_admin has_attached_file
会引发错误
undefined method `attachment_definitions'
Run Code Online (Sandbox Code Playgroud)
我在主git分支和受保护的属性gem中使用Rails 4和rails_admin.
我见过Ryan railcasts第274集我正在使用rails 4并遇到一个问题.
在password_resets_controller.rb中
elsif @user.update_attributes(params[:user])
Run Code Online (Sandbox Code Playgroud)
在控制台中显示
ActiveModel::ForbiddenAttributesError in PasswordResetsController#update
Run Code Online (Sandbox Code Playgroud)
当我修改update_attributes
,以update_attribute
它显示
wrong number of arguments (1 for 2)
Run Code Online (Sandbox Code Playgroud)
params[:user]
显示两个值password
,password_confirmation
但我password
在我的登录页面中使用
我不知道如何解决这个问题.
我有这些联想:
class Course < ActiveRecord::Base
has_many :signup
has_many :user, :through => :signup
accepts_nested_attributes_for :signup
end
class User < ActiveRecord::Base
has_many :signup
has_many :course, :through => :signup
accepts_nested_attributes_for :signup
end
class Signup < ActiveRecord::Base
belongs_to :course
belongs_to :user
end
Run Code Online (Sandbox Code Playgroud)
现在,我想为"注册"自定义ActiveAdmin表单,因此它显示了课程的标题和用户的名称作为选择而不是文本字段.
默认表单已经这样做,但是我需要进一步自定义表单,我无法重现默认表单.
我的模板文件中有以下代码:
{foreach from=$items item=entry}
<pre>
{$entry->nb_persons|@print_r}
</pre>
{/foreach}
Run Code Online (Sandbox Code Playgroud)
输出是(json字符串):
{"ip":"12.12.12.12","date":1375616434,"cartitems":["foo:1"],"company":"dsad","FirstName":"sad","LastName":"asdsad","street":"","postcode":"","city":"","country":"Andorra","phone":"456456","fax":"","email":"sad@sad.com","comefrom":"google","request":"","message":"sadads"}
我想打印每个分开的元素,例如:
{$entry->nb_persons.company}
应该给我 - >"dsad"
但这不起作用,我不知道为什么.
android ×3
activeadmin ×1
annotations ×1
devise ×1
doctrine-orm ×1
facebook ×1
indexing ×1
json ×1
mysql ×1
paperclip ×1
php ×1
rails-admin ×1
redirect ×1
regex ×1
ruby ×1
smarty ×1
smarty3 ×1