在AFNetworking 2.0上找不到AFHTTPClient,使用:
AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://examplewebsite.com]];
[client setAuthorizationHeaderWithUsername:@"username" password:@"password"];
Run Code Online (Sandbox Code Playgroud)
如何在AFNetworking 2.0上进行管理?
如何在UISearchBar中以编程方式触发取消按钮,就像你点击了取消按钮一样?
我在UITableView的顶部有一个UISearchBar,在搜索之后,当有人选择一行时,我想在UISearchBar中以编程方式触发取消按钮?
编辑:没有用户交互.
我努力让actionbarsherlock + tabs + fragment工作.
我只能让这套作为静态工作,我想创建这个像Android市场应用程序(滑动运动).
当你需要用里面的多个片段来扩充布局时,我会陷入困境.
在Support4demos中,我以FragmentsTabsPager为例进行了跟踪.
我想继续部署(或强制),即使资源已经存在。
Atm我收到此错误:
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: AvailableDynamoDbTable
- Available already exists.
Run Code Online (Sandbox Code Playgroud) 如何以更好的质量渲染图像?
该节点是一个带有css的窗格:
.imagePane {
-fx-background-repeat: no-repeat;
-fx-background-image: url('../../img/logo/icon_white.png');
-fx-background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)
应用程序内的图像:
链接到PSD:https://drive.google.com/file/d/0B0YK52wzjJg3c2NFc0NSTDNKWGM/view? usp =sharing
我试图把最好的图像质量但它仍然导致像素化
我在Mandrill中创建了一个模板,但我不知道如何使用它来发送电子邮件.
以下是如何将其与简单的html一起使用的示例:
<?php
include_once "swift_required.php";
$subject = 'Hello from Mandrill, PHP!';
$from = array('you@yourdomain.com' =>'Your Name');
$to = array(
'recipient1@example.com' => 'Recipient1 Name',
'recipient2@example2.com' => 'Recipient2 Name'
);
$text = "Mandrill speaks plaintext";
$html = "<em>Mandrill speaks <strong>HTML</strong></em>";
$transport = Swift_SmtpTransport::newInstance('smtp.mandrillapp.com', 587);
$transport->setUsername('MANDRILL_USERNAME');
$transport->setPassword('MANDRILL_PASSWORD');
$swift = Swift_Mailer::newInstance($transport);
$message = new Swift_Message($subject);
$message->setFrom($from);
$message->setBody($html, 'text/html');
$message->setTo($to);
$message->addPart($text, 'text/plain');
if ($recipients = $swift->send($message, $failures))
{
echo 'Message successfully sent!';
} else {
echo "There was an error:\n";
print_r($failures);
}
?>
Run Code Online (Sandbox Code Playgroud) 我想创建一个像android市场的网格视图,我想用互联网上的数据库中的图像填充它.它需要使用androidv4.support,因为我想运行2.2直到4.0.
有人说,这不可能在4.0之前创建一个gridview,这是真的吗?
但是它只在我使用时才有效setListAdapter()
,但它每行只显示一个图像,就像列表视图一样,当我改变gridview.setAdapter()
它时,它再也没有工作了.
这是我的尝试:
这是ListFragment类:
public static class ArrayListFragment extends ListFragment implements OnScrollListener{
ImageAdapter adapter = new ImageAdapter();
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
LayoutInflater gridInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = gridInflater.inflate(R.layout.imagelist, null);
GridView gridView = (GridView) v.findViewById(R.id.list);
ImageDownloader.Mode mode = ImageDownloader.Mode.CORRECT;
// ImageAdapter imageAdapter = new ImageAdapter();
adapter.getImageDownloader().setMode(mode);
setListAdapter(adapter);
// gridView.setAdapter(adapter);
getListView().setOnScrollListener(this);
}
Run Code Online (Sandbox Code Playgroud)
这是ImageAdapter类:
public class ImageAdapter extends BaseAdapter {
private Context mContext;
private final ImageDownloader imageDownloader = new ImageDownloader();
public static int …
Run Code Online (Sandbox Code Playgroud) 我想创建一个像Android市场第一页的布局.我正在尝试使用gridlayout,因为我想将imageview放入不同的大小和位置,我还需要输入scrollview.
其实我的问题是如何在android.support.v7.widget.GridLayout中输入scrollview?
我试过了:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.astuetz.viewpager.extensions.example"
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:columnCount="10" >
<ImageView
android:id="@+id/ImageView1"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="1"
android:src="@drawable/tab_background_focused" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_column="5"
app:layout_gravity="bottom"
app:layout_row="1"
android:ems="10" >
<requestFocus />
</EditText>
<ImageView
android:id="@+id/ImageView2"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="1"
app:layout_columnSpan="3"
app:layout_gravity="left"
app:layout_row="2"
android:src="@drawable/tab_background_focused" />
<ImageView
android:id="@+id/ImageView3"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="4"
app:layout_rowSpan="2"
android:src="@drawable/tab_background_focused" android:adjustViewBounds="true"/>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="7"
android:src="@drawable/background_dots" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="9" android:adjustViewBounds="true" android:src="@drawable/tab_background"/>
<ImageView
android:id="@+id/imageView5" …
Run Code Online (Sandbox Code Playgroud) 图书馆:
在Sample中PullToRefreshListInViewPagerActivity
仅适用于PageAdapter.
我无法找到一种方法来使用它FragmentPageAdapter
.
样品:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ptr_list_in_vp);
mViewPager = (ViewPager) findViewById(R.id.vp_list);
mViewPager.setAdapter(new ListViewPagerAdapter());
}
private class ListViewPagerAdapter extends PagerAdapter {
@Override
public View instantiateItem(ViewGroup container, int position) {
Context context = container.getContext();
PullToRefreshListView plv = (PullToRefreshListView) LayoutInflater.from(context).inflate(
R.layout.layout_listview_in_viewpager, container, false);
ListAdapter adapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1,
Arrays.asList(STRINGS));
plv.setAdapter(adapter);
plv.setOnRefreshListener(PullToRefreshListInViewPagerActivity.this);
// Now just add ListView to ViewPager and return it
container.addView(plv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
return plv;
}
@Override
public void destroyItem(ViewGroup …
Run Code Online (Sandbox Code Playgroud) iframe
我有一个网站,它使用sandbox
-Attribute 设置为来嵌入用户定义的页面allow-scripts
。
嵌入式网站本身也是由我托管的(它来自同一源服务器),但它包含潜在不安全的 Javascript。我不想将allow-same-origin
值添加到sandbox
属性中,因为这会破坏整个目的。
嵌入页面的Content-Security-Policy
标题设置如下:
Content-Security-Policy: style-src 'self' https://example.com/webjars/ https://example.com/css/ 'unsafe-inline' blob:; script-src 'self' https://example.com/webjars/ https://example.com/js/ 'unsafe-eval' 'unsafe-inline' blob:; default-src 'none'; navigate-to 'none'
Run Code Online (Sandbox Code Playgroud)
example.com
我的域名在哪里。
嵌入页面尝试使用以下代码动态添加Javascript/CSS:
Content-Security-Policy: style-src 'self' https://example.com/webjars/ https://example.com/css/ 'unsafe-inline' blob:; script-src 'self' https://example.com/webjars/ https://example.com/js/ 'unsafe-eval' 'unsafe-inline' blob:; default-src 'none'; navigate-to 'none'
Run Code Online (Sandbox Code Playgroud)
这应该是允许的,并且它在 Chrome(桌面/Windows+MacOS)上运行良好。
但是,在 Chrome Mobile (iOS) 和 Safari(MacOS、iOS)上,它拒绝执行 Javascript 和 CSS。在控制台上,弹出以下消息:
[blocked] The page at https://example.com/embedded_page_url was not allowed to run insecure content from blob:null/<uuid>. …
Run Code Online (Sandbox Code Playgroud) android ×4
blob ×1
css ×1
fragment ×1
grid-layout ×1
gridview ×1
html5-video ×1
ios ×1
ios7 ×1
iphone ×1
java ×1
javafx ×1
javascript ×1
lambda ×1
mandrill ×1
php ×1
safari ×1
scrollview ×1
tabs ×1
templates ×1
uisearchbar ×1