在Android 3.0中,"已检查"的概念可以使用"激活"背景进行渲染.这为您提供了在点击列表片段时看到的持久性栏,为列表右侧提供片段的上下文(例如,点击Gmail中的文件夹突出显示该文件夹并打开另一个列表片段以显示该文件夹中的对话).
例如,片段样本显示如下内容:
setListAdapter(new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_activated_1, Shakespeare.TITLES));
Run Code Online (Sandbox Code Playgroud)
该资源(android.R.layout.simple_list_item_activated_1)是Android 3.0的新功能.它被"激活"的原因是:
android:background="?android:attr/activatedBackgroundIndicator"
Run Code Online (Sandbox Code Playgroud)
该属性值是Android 3.0的新功能,如果您尝试在早期版本的Android上使用它,将导致您崩溃,据我所知.我想为3.0/large/landscape组合设置背景为这个魔术值,否则将跳过它.
我可以通过布局的两个单独版本来实现这一点,一个在-v11资源集中,一个在常规资源集中.但是,这比我想要的要少一些,因为大部分布局是相同的,只有这一个属性被包含或被跳过.
我试图使用可绘制的资源别名,所以android:background可以引用别名,别名将处理-v11差异,但<bitmap>drawable似乎不喜欢android:src="@null".
我怀疑这个问题有一种样式和主题的方法,但由于我从来没有完全围绕那些(我的一个更令人尴尬的Android知识差距),我不完全确定该怎么做.
有没有人制定过在3.0上使用"激活"并在3.0之前跳过它的模式,超出了单独的布局?
谢谢!
使用GLSL进行计算的OpenCL有哪些特性可供选择?尽管有与图形相关的术语和非实用的数据类型,但对OpenGL有什么实际的警告吗?
例如,可以通过使用其他纹理渲染纹理来完成并行函数评估.减少操作可以通过迭代渲染到越来越小的纹理来完成.另一方面,无法以任何有效的方式进行随机写访问(唯一的方法是通过纹理驱动的顶点数据渲染三角形).这可能与OpenCL有关吗?OpenGL还有什么不可能实现的?
我是rails的新手,我不明白使用new + save方法和create方法之间的区别.
def create
@item = Item.new(params[:item])
respond_to do |format|
if @item.save
format.html { redirect_to @item, notice: 'Item was successfully created.' }
format.json { render json: @item, status: :created, location: @item }
else
format.html { render action: "new" }
format.json { render json: @item.errors, status: :unprocessable_entity }
end
end
end
Run Code Online (Sandbox Code Playgroud)
和:
def create
respond_to do |format|
if Item.create(params[:item])
format.html { redirect_to @item, notice: 'Item was successfully created.' }
format.json { render json: @item, status: :created, location: @item }
else …Run Code Online (Sandbox Code Playgroud) 如何在本地删除空文件夹,以及通过pull-push共享远程的其他协作者会发生这种情况?我知道git在这个意义上没有"跟踪"文件夹,但问题仍然存在.
例如,我将文件移动到另一个文件夹并提交了更改(移动).
但我不能git rm name文件夹,因为我得到"不匹配"
git rmdir name不存在.
我可以做一个git clean -f folder但是怎么会被推高?
我可以直接rm将文件,但如何获取该目录去除正确完成并推到仓库,然后出去给别人当他们拉让自己现有的文件夹被删除?
$ sudo bundle install
Run Code Online (Sandbox Code Playgroud)
结果
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.4)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.11)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo …Run Code Online (Sandbox Code Playgroud) 从头开始重建mac.安装xcode和rvm然后尝试安装红宝石,但他们都给了我:
Error running ' ./configure --prefix=/Users/durrantm/.rvm/rubies/ruby-1.9.3-p125
--enable-shared --disable-install-doc --with-libyaml
--with-opt-dir=/Users/durrantm/.rvm/usr ',
please read /Users/durrantm/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
Michaels-MacBook-Air:~ durrantm$
Run Code Online (Sandbox Code Playgroud)
日志有:
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/durrantm/.rvm/src/ruby-1.9.2-p290':
configure: error: no acceptable C compiler found in $PATH
Run Code Online (Sandbox Code Playgroud)
我需要gcc C compliler吗?我该如何安装?
而不是tmux每次都要打字,我怎么能tmux一直用于新的会话窗口?
所以,如果我没有打开终端窗口然后打开一个,第一个会话怎么样tmux?
看起来似乎.bashrc有点像?
自Dreamhost几周前升级服务器以来,我的网站已被破坏.我一直在撕扯我的头发试图修复它并取得了一些进展,但我坚持希望最后的问题.
我在Ruby 1.8.7上使用Rails 3.1.1,并从PhusionPassenger获得一个'Ruby(Rack)应用程序无法启动错误'.它声明它'找不到JavaScript运行时.有关可用运行时的列表,请参阅https://github.com/sstephenson/execjs.(ExecJS :: RuntimeUnavailable)".在Dreamhost的维基上搜索这个已经建议安装'therubyracer'宝石的解决方案.
所以我使用建议的gem更新了我的gemfile,如下所示:
gem'therubyracer','〜> 0.9.9'
编辑:我也尝试添加到文件:
gem'therubyracer',: platforms =>:ruby
但它并没有什么不同.
然后捆绑安装在我的Macbook(运行OS X 10.5.8)上,没有任何障碍.但是,当我运行'cap deploy'来放置Dreamhost时,这会失败; 当我尝试安装therubyracer依赖的libv8时,我看到一个错误.
任何人都知道如何正确安装或任何其他工作解决方案?
可根据要求提供任何其他信息.
终端的完整错误反馈:
- 执行"cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703&& bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/捆绑 - 部署 - 安静 - 没有开发测试"服务器:["abunchofletters.co.uk"] [abunchofletters.co.uk]执行命令**[out :: abunchofletters.co.uk]不幸的是,一个致命的错误已经发生了.请通过https://github.com/carlhuda/bundler/issues向Bundler问题跟踪器报告此错误, 以便我们对其进行修复.谢谢!**[out :: abunchofletters.co.uk] /usr/lib/ruby/1.8/rubygems/installer.rb:483:in
build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) ** [out :: abunchofletters.co.uk] ** [out :: abunchofletters.co.uk] /usr/bin/ruby1.8 extconf.rb ** [out :: abunchofletters.co.uk] *** extconf.rb failed *** ** [out :: abunchofletters.co.uk] Could not …
我不得不删除我的虚拟盒.vhd文件.我现在正试图从另一台机器恢复它们但得到:
Virtual Box UUID {07c3.........} does not match the value {2c1b...}
stored in the media registry ('/home/durrantm/.VirtualBox/VirtualBox.xml')
Run Code Online (Sandbox Code Playgroud)
怎么克服?
我对内容类型有非常基本的理解问题.
我通过大量的例子和文字解释了上述术语,但仍然有一些基本的理解问题.有些人可以澄清一下.
在Android记事本例子中,和其他许多人,它被提及vnd.android.cursor.dir /解析为项目的目录清单,并vnd.android.cursor.item /是指特定项目的目录.
这是vnd.android.cursor.dir由android定义的一些标准常量.这是从哪里来的?或者我可以改变它
vn.com.android.myexample.dir /
这是如何解决的,它的目的是什么,为什么不使用完整的CONTENT_URI?
对不起,我完全迷路了,不明白这一点.