我有一个UITableView与cells被动态地更新.一切正常,除了tableview.reload调用时(见下文)刷新cells表中我希望表滚动到底部以显示新条目.
- (void)reloadTable:(NSNotification *)notification {
NSLog(@"RELOAD TABLE ...");
[customTableView reloadData];
// Scroll to bottom of UITable here ....
}
Run Code Online (Sandbox Code Playgroud)
我打算使用scrollToRowAtIndexPath:atScrollPosition:animated:但后来注意到我无法访问indexPath.
有谁知道怎么做,或者delegate我可以使用的回调?
我有 sqlite database
private static final String DB_PROCESS_CREATE = "create table "
+ DB_TABLE_PROCESS + "(" + PROCESS_ID
+ " integer primary key autoincrement, "
+ PROCESS_DATE + " date);";
Run Code Online (Sandbox Code Playgroud)
我创造它 db.execSQL(DB_PROCESS_CREATE);
如何在此数据库中添加日期值?我试过了 :
String date = new SimpleDateFormat("yyyy.MM.dd").format(Calendar
.getInstance().getTime());
ContentValues cv = new ContentValues();
cv.put(db.PROCESS_DATE,Date.valueOf(date));
db.mDB.insert(db.DB_TABLE_PROCESS, null, cv));
Run Code Online (Sandbox Code Playgroud)
但后来我得到error:
"The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Date)".
Run Code Online (Sandbox Code Playgroud) 我正在开始objective-c开发,我想问一下实现键和值列表的最佳方法.
在Delphi中有类TDictionary,我使用它是这样的:
myDictionary : TDictionary<string, Integer>;
bool found = myDictionary.TryGetValue(myWord, currentValue);
if (found)
{
myDictionary.AddOrSetValue(myWord, currentValue+1);
}
else
{
myDictionary.Add(myWord,1);
}
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做objective-c?是否有与上述相同的功能AddOrSetValue() or TryGetValue()?
谢谢.
在我的Android应用程序中,我正在使用LibVLC库显示实时视频流.要连接SSH服务器,我使用过jsch库.
当我运行应用程序时,会话连接视频正常运行后.当我最小化应用程序3-4分钟,并再次恢复仍然视频运行正常.但是当我将应用程序最小化10分钟或更长时间并在恢复时它会显示session timeout消息.
OnResume()我试图创建会话createPlayer()但仍然没有工作.
我试过改变会话连接时间.
有没有办法避免会话超时很长一段时间,如30分钟.
//**编辑后**//
在onResume()会话仍然连接后我检查了,错误日志说Connection reset by peer.
那是什么意思?ssh隧道是关闭的吗?如果是,如何检查ssh隧道状态?
错误日志:
十月8日至9日:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample E/VLC:LIVE555 DEMUX:无法使用RTSP连接://本地主机:8554/video.ts十月8日至9日:52:15.268 6529-21339 /com.compdigitec.libvlcandroidsample d/VLC:核心解复用:没有access_demux模块匹配10月八日至九日:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample d/VLC:核心输入:创建访问 'RTSP' 位置='本地主机:8554/video.ts',path ='(null)'08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample D/VLC:核心访问:寻找匹配"rtsp"的访问模块:15名候选人十月8日至9日:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample d/VLC:核心接入:净:连接到本地主机端口8554 10月8日至九日:52:15.278 6529-21339/com.compdigitec.libvlcandroidsample d/VLC:核心访问:连接成功(socket = 36)08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC:核心访问:读取错误:连接重置由对等08-09 10:52: 35.823 6529-21339/com.compdigitec.libvlcandroidsample D/VLC :access_realrtsp访问:RTSP连接十月8日至9日:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample W/VLC:access_realrtsp访问:支持现在十月8日至9日唯一真正/螺旋RTSP服务器:52:35.823 6529-21339 /com.compdigitec.libvlcandroidsample d/VLC:核心接入:没有访问模块相匹配10月8日至9日:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC:核心输入:开放的rtsp的://本地主机:8554 /video.ts'失败10月8日至9日:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC:核心输入:您的输入无法打开10月8日至9日:52:35.823 6529-21339/COM .compdigitec.libvlcandroidsample E/VLC:核心输入:VLC无法打开MRL'rtsp:// localhost:8554/video.ts'
我有一个,UITextView并希望根据其内容变化设置其高度.
如何获得内容的高度.
请指导我.
提前致谢.
升级到Xcode7之后,我们设置的机器人无法构建,并出现以下错误:
2015-09-23 15:57:22.989 xcodebuild[23194:3737599] [MT] iPhoneSimulator: Could not launch simulator: -1712
xcodebuild: error: Failed to build workspace *XXX* with scheme YYY.
Reason: The operation couldn’t be completed. (OSStatus error -1712.)
Run Code Online (Sandbox Code Playgroud)
机器人设置为iPads与之对抗IOS 9.0.
请建议我.
谢谢.
我能够在我的应用程序中设置沉浸式模式navigation,status bars在几乎所有情况下都可以正确隐藏。我迄今发现的唯一的排斥是,当我点击一个Spinner有分量
android:spinnerMode="dropdown"的navigation bar还是来了。从下拉列表中选择一个项目后它就会消失,但我希望它根本不显示。有没有办法做到这一点?
我有一个SwitchCompat:
<android.support.v7.widget.SwitchCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Some title"/>
Run Code Online (Sandbox Code Playgroud)
我想阻止点击文字标题.当我点击文字标题时,切换开关.但我想切换只在我点击切换图标.
可能吗?或者我必须为此创建两个单独views的:一个TextView用于标题,一个用于SwitchCompat没有文本?
我是 Android 新用户,正在使用 Android Studio 1.3。我想创建简单的启动屏幕,为此,我创建不同的可绘制文件夹,在其中存储启动屏幕背景图像。我从相应的 mipmap 文件夹中复制所有 ic_launcher 并将它们粘贴到相应的可绘制文件夹中。并更改清单中的图标路径,
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
Run Code Online (Sandbox Code Playgroud)
到,
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
Run Code Online (Sandbox Code Playgroud)
但这给了我错误,
Error:(14, 24) No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').
Run Code Online (Sandbox Code Playgroud)
我的问题是,
我们是否总是需要将应用程序图标存储在 mipmap 文件夹中?为什么?
何时使用 mipmap 和drawable?
Android SQLLite给出了以下错误:
SQLiteStatement tgStatement = dbo.compileStatement("INSERT OR REPLACE INTO Game_Team" +
"(teamId, gameId, pos, score) VALUES (?,?,?,?) ");
Run Code Online (Sandbox Code Playgroud)
这就是我尝试做的原因:
tgStatement.bindLong(0, 1);
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
java.lang.IllegalArgumentException: Cannot bind argument at index 0 because the index is out of range.
该陈述有4个参数.
所以,我的问题是,如果有4个参数,为什么它抱怨索引0处的参数?怎么会超出范围?
我现在正在将Eclipse项目迁移到Android Studio.当我构建项目时,我得到以下错误gradle.
\...\res\values\strings.xml
>"Error: Unsupported type 'add-resource'"
Run Code Online (Sandbox Code Playgroud)
问题strings.xml在于:
<add-resource type="string" name="default_folder_name" />
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
提前致谢.
如何在app delegate中添加UINavigationController&以UITabBarController编程方式.
objective-c uitabbarcontroller uinavigationcontroller ios appdelegate
android ×7
objective-c ×4
ios ×3
iphone ×2
sqlite ×2
appdelegate ×1
bots ×1
click ×1
cocoa-touch ×1
database ×1
date ×1
drawable ×1
height ×1
java ×1
jsch ×1
manifest ×1
onclick ×1
session ×1
switchcompat ×1
text ×1
uitextview ×1
xcode ×1