程序设计

专业和发烧友程序员的问答

25
Android如何在可见软键盘时在全屏模式下调整布局
当软键盘处于活动状态时,我已经进行了很多研究来调整布局,并且我已经成功实现了它,但是当我android:theme="@android:style/Theme.NoTitleBar.Fullscreen"在清单文件中的活动标签中使用它时,问题就来了。 为此,我使用android:windowSoftInputMode="adjustPan|adjustResize|stateHidden"了其他选项,但没有运气。 之后,我以FullScreen编程方式实施并尝试使用各种布局,FullScreen但徒劳无功。 我引用了这些链接,并在此处查找了许多与此问题相关的帖子: http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html http://davidwparker.com/2011/08/30/android-how-to-float-a-row-above-keyboard/ 这是xml代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/masterContainerView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:background="#ffffff"> <ScrollView android:id="@+id/parentScrollView" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TextView android:id="@+id/setup_txt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Setup - Step 1 of 3" android:textColor="@color/top_header_txt_color" android:textSize="20dp" android:padding="8dp" android:gravity="center_horizontal" /> <TextView android:id="@+id/txt_header" android:layout_width="fill_parent" android:layout_height="40dp" android:text="AutoReply:" android:textColor="@color/top_header_txt_color" android:textSize="14dp" android:textStyle="bold" android:padding="10dp" android:layout_below="@+id/setup_txt" …



5
如何以相反的顺序git登录?
我最近了解到,我可以通过以下方式获取hg日志以相反的顺序打印历史记录: hg log -r : 因此,我当然尝试过: git log -r : 好吧,那没有用。那么在git中执行相同操作的命令是什么?
178 git  git-log 

1
如何在iOS上使用Phonegap正确检测方向变化?
我在下面找到此定向测试代码,以查找JQTouch参考资料。这可以在移动Safari上的iOS模拟器中正常运行,但在Phonegap中无法正确处理。我的项目遇到了与杀死该测试页相同的问题。有没有办法在Phonegap中使用JavaScript来感知方向变化? window.onorientationchange = function() { /*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the left, or landscape mode with the screen turned to the right. */ var orientation = window.orientation; switch (orientation) { case 0: /* If in portrait …


6
Heroku / devise-找不到要链接的主机!请提供:host参数或设置default_url_options [:host]
我正在尝试将我的应用程序推送到heroku。我仍然在开发中。我将设计与可确认模块一起使用。 当我尝试使用heroku控制台添加用户时,出现此错误: Missing host to link to! Please provide :host parameter or set default_url_options[:host] 在测试和开发环境中,我有以下内容: 环境/development.rb和环境/test.rb config.action_mailer.default_url_options = { :host => 'localhost:3000' } 我没有在生产环境中设置任何东西。 我试图推动 config.action_mailer.default_url_options = { :host => 'mywebsitename.com' } config.action_mailer.default_url_options = { :host => 'heroku.mywebsitename.com' } 但这也行不通.. 我在网上看到它可能与ActionMailer有关,但是我不知道必须配置什么。非常感谢您的想法! 编辑: 你好 为了避免在我按下heroku时我的应用程序崩溃,我将其放在env / test.rb和env / dev.rb中(不是在env.rb中,我认为这是因为它是Rails 3应用程序) config.action_mailer.default_url_options …


5
类型无效,不能用作索引中的键列
我有一个错误 Column 'key' in table 'misc_info' is of a type that is invalid for use as a key column in an index. 其中key是nvarchar(max)。一个快速的谷歌发现了这个。但是,它没有解释什么是解决方案。我该如何创建类似于Dictionary之类的东西,其中键和值都是字符串,并且显然键必须是唯一的且是单个的。我的sql语句是 create table [misc_info] ( [id] INTEGER PRIMARY KEY IDENTITY NOT NULL, [key] nvarchar(max) UNIQUE NOT NULL, [value] nvarchar(max) NOT NULL);

5
将在具有空对象的using语句中调用Dispose()吗?
using在(可能)空对象上使用该语句是否安全? 考虑以下示例: class Test { IDisposable GetObject(string name) { // returns null if not found } void DoSomething() { using (IDisposable x = GetObject("invalid name")) { if (x != null) { // etc... } } } } 是否保证Dispose仅在对象不为null且不会得到的情况下才调用该方法NullReferenceException?
178 c#  idisposable  using 

20
Xcode源自动格式化
作为一个C#开发人员,我已经在Visual Studio 2008中变得高度依赖于自动格式化具体来说,我会用CTRL+ K,D键盘快捷键力的东西放回形状我的草率实施后。 我现在正在尝试学习Objective-C,并且缺少Xcode的某些功能,但可能没有一个比格式化快捷键那么痛苦。我的Google搜索没有产生任何内置结果,尽管似乎有些黑客。我是否缺少某些东西,或者Xcode本身不存在此功能?

20
如何设置视图的背景色
我正在尝试设置视图(在这种情况下为按钮)的背景颜色。 我使用以下代码: // set the background to green v.setBackgroundColor(0x0000FF00 ); v.invalidate(); 这会使按钮从屏幕上消失。我在做什么错,在任何视图上更改背景颜色的正确方法是什么? 谢谢。
178 android  view  colors  background  set 

11
JavaScript中的':'(冒号)有什么作用?
我正在学习JavaScript,并且在浏览jQuery库时发现:(冒号)被大量使用。这在JavaScript中有什么用? // Return an array of filtered elements (r) // and the modified expression string (t) return { r: r, t: t };
178 javascript 



By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.