小编Jon*_*fer的帖子

Swift如何更改UIAlertController的标题颜色

如何使用Swift更改UIAlertController的Title字体?

我不是在谈论消息颜色,我不是在谈论按钮颜色.

我在谈论标题.

user-interface xcode ios swift

13
推荐指数
3
解决办法
2万
查看次数

如何制作视图滚动?就像Instagram的个人资料一样

在ScrollView中的UIView,SegmentedController和UIContainerView或类似的东西?

在我的故事板中,我有一个VC包含顶部的UIView,中间的分段控制器和底部的2个ContainerViewControllers,嵌入了新的VC的segue.

在新的VC中我有一个TableView和一个CollectionView(例如,Instagram的个人资料).

我的问题是我需要SegmentedController和UIView使用ContainerView(TableView/CollectionView)滚动,此时只有ContainerView部分滚动并且上面的部分是固定的.

现在我猜我可能需要将所有内容放入UIScrollView中,所以我尝试了并正确放置了所有的成本.但是当它在Swift文件中进行配置时,我现在只是如何设置滚动的高度,但是我需要的高度显然可以变化并且不是固定的高度!

如果有人可以在这里帮助我,这将是非常棒的,或者可能指向我这里已经问过的类似问题?我已经看了,但遗憾的是没找到任何东西!

下面的图片基本上解释了我所追求的内容,如果上面我不是很清楚..

这是一个你可以看到的例子:https://github.com/Jackksun/ScrollIssue

在此输入图像描述

uiscrollview uiview ios swift

13
推荐指数
1
解决办法
1777
查看次数

如何在活动中添加Google日历中的活动?

我尝试使用内容提供商,但事件未添加到日历中.

final ContentResolver cr = ctx.getContentResolver();

ContentValues cv = new ContentValues();    
cv.put("calendar_id", l_calId);    
cv.put("title", title);    
cv.put("description", description);    
cv.put("dtstart", millis1 );    
cv.put("hasAlarm", 1);   
cv.put("dtend", millis2);    
cv.put("eventLocation", "Hall: "+location);    
cv.put("transparency", 1);    
cv.put("hasAlarm", 1);    


Uri newEvent ;    
if (Integer.parseInt(Build.VERSION.SDK) == 8 )    
    newEvent = cr.insert(Uri.parse("content://com.android.calendar/events"), cv);    
else    
    newEvent = cr.insert(Uri.parse("content://com.android.calendar/events"), cv);
Run Code Online (Sandbox Code Playgroud)

events android google-calendar-api

11
推荐指数
1
解决办法
8040
查看次数

在SimpleCursorAdapter中使用哪个标志?

我用SimpleCursorAdapter送我读出的数据databaseListView.

SimpleCursorAdapter 有2个标志,其中一个已被弃用.

我应该经常使用FLAG_CONTENT_OBSERVER吗?

或者使用其他东西而不是更好SimpleCursorAdapter

sqlite flags android cursor simplecursoradapter

10
推荐指数
1
解决办法
6090
查看次数

为什么每次选择另一个TextField时都会调用UIKeyboardWillShowNotification?

我有一个项目,其中包含一个UIScrollView和许多UITextField内部.

我第一次选择a UITextField,UIKeyboardWillShowNotification被称为,这很好.但每当我选择新的UITextField(键盘仍在那里),UIKeyboardWillShowNotification再次调用!!!,这很奇怪.

我还设置了一个符号断点[UIResponder resignFirstResponder],我看到它UIKeyboardWillShowNotification被调用之前和之后!

另一件事是UIKeyboardWillHideNotification只有当我点击键盘上的"完成"按钮时才会调用它

我敢肯定,不调用任何resignFirstResponder,becomeFirstResponder,endEditing任何地方.(我的意思是不要错误地打电话)

什么可能导致这个问题?

这是堆栈跟踪 在此输入图像描述

xcode notifications first-responder ios

10
推荐指数
3
解决办法
2万
查看次数

存储WebView以进行脱机浏览

加载页面后,强制Android将webview存储到媒体的最佳方法是什么?

更多细节:

  • 每个页面都将丰富的图像,脚本和样式.

  • 每页大约0.5到1兆字节.

  • 一旦调用OnFinishedLoading Override,它们将被保存.

  • 最好将其保存到SD卡,然后使用本地仓库将其打开备份.

不确定我是否应该只为webview使用sql数据库,或者采用每个视图并写出文件.

如果我做后者,那么最简单的方法是什么,所以我不必写一个完整的webcrawler来连接每个文件?

html html5 android webview android-webview

9
推荐指数
1
解决办法
9690
查看次数

是否可以禁用listView上的滚动?

我动态地向a添加项目,ListView并希望使所有项目始终可见,而无需滚动.

布局代码:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/recipe_inside"
android:orientation="vertical" >

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="16dp"
            android:src="@drawable/head_cella" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="41dp"
            android:background="@drawable/body_cella"
            android:gravity="center_horizontal"
            android:paddingTop="5dp"
            android:text="Remember to save before leaving this page or inserted/modified data will be lost."
            android:textColor="#000000"
            android:textSize="13dp" />

        <ImageView
            android:id="@+id/ImageView01"
            android:layout_width="match_parent"
            android:layout_height="16dp"
            android:layout_marginTop="30dp"
            android:src="@drawable/head_cella" />

        <TextView
            android:id="@+id/TextView01"
            android:layout_width="wrap_content"
            android:layout_height="35dp"
            android:background="@drawable/body_cella"
            android:gravity="center_horizontal"
            android:paddingTop="10dp"
            android:text="Category"
            android:textColor="#000000"
            android:textSize="15dp" />

        <Spinner
            android:id="@+id/category_spinner"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <ImageView
            android:id="@+id/ImageView02"
            android:layout_width="match_parent"
            android:layout_height="16dp"
            android:layout_marginTop="30dp"
            android:src="@drawable/head_cella" /> …
Run Code Online (Sandbox Code Playgroud)

android listview android-layout

9
推荐指数
1
解决办法
1万
查看次数

如何将PDF格式转换为图像?

使用pdfbox会显示错误:

import java.awt
import javax`
Run Code Online (Sandbox Code Playgroud)

基于以下代码:

imageType = BufferedImage.TYPE_INT_ARGB; //need to specifies java.awt
String[] formats = ImageIO.getReaderFormatNames(); //need to specifies javax
Run Code Online (Sandbox Code Playgroud)

pdf android image-conversion

9
推荐指数
1
解决办法
1万
查看次数

雅虎身份验证中的400错误请求

我正在尝试将Yahoo集成到我的应用程序中.

我希望用户使用他们的Yahoo帐户登录,但每当我请求令牌时,我都会收到以下错误:

getRequestToken() Exception: oauth.signpost.exception.OAuthCommunicationException: 
Communication with the service provider failed: Service provider responded in error: 400 (Bad Request)
Run Code Online (Sandbox Code Playgroud)

这是我的代码(Request_Token_Activity.java):

import oauth.signpost.OAuth;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.OAuthProvider;
import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;
import oauth.signpost.commonshttp.CommonsHttpOAuthProvider;
import oauth.signpost.signature.HmacSha1MessageSigner;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;

public class Request_Token_Activity extends Activity {
    private OAuthConsumer consumer; 
    private OAuthProvider provider;
    private SharedPreferences prefs;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {

        consumer = new CommonsHttpOAuthConsumer("my consumer key", "my consumer …
Run Code Online (Sandbox Code Playgroud)

yahoo android yahoo-api

8
推荐指数
1
解决办法
2053
查看次数

为什么领先/尾随空格显示为-16?

当我将Xcode从版本5更新为6时,我在故事板中看到了一些奇怪的东西.这是一个例子:

  • 我的要求是什么 - 我希望我的视图和容器视图之间没有空格.
  • 我做了什么 - 我将视图左/右边拖动,以便它符合容器边距.然后我放了一个水平间距约束.

之前的价值是 - 领先/尾随空间:Superview Equals:0

现在更新到Xcode 6后,它总是显示 - 前导/尾随空间:Superview Equals:-16.000000

为什么会这样?

ios xcode-storyboard

8
推荐指数
2
解决办法
4654
查看次数