我试图在一个具有设定高度的容器中将多个项目放在彼此之下.如果没有空间,物品将彼此相邻.
这是个主意:
我试图使用flexbox实现这一点,flexbox是一个设置高度的容器,方向设置为column
并且flex-wrap
是wrap
:
问题是列之间存在很大差距.
我试着设置都justify-content
和align-items
到flex-start
,但是这可能是默认值.
有什么方法可以解决这个问题吗?
这是代码:
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
.container {
display: flex;
flex-wrap: wrap;
height: 300px;
flex-direction: column;
background-color: #ccc;
}
.items {
width: 100px;
height: 100px;
margin: 10px;
background-color: tomato;
color: white;
font-size: 60px;
font-weight: bold;
text-align: center;
padding: 15px;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div class="items">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items">4</div>
<div class="items">5</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我一直ProgressBar
在我的应用程序中添加片段.我将其设置为两个主要片段(用作选项卡),如下所示:
ProgressBar
在activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
设置ProgressBar
VISIBLE
和GONE
:
spinner = (ProgressBar)getActivity().findViewById(R.id.progressBar1);
spinner.setVisibility(View.VISIBLE);
spinner.setVisibility(View.GONE);
Run Code Online (Sandbox Code Playgroud)
这没有任何问题.我试图将ProgressBar
另一个片段添加到另一个片段,其中包含WebView
:
ProgressBar
在fragment_article.xml
:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.androidhive.slidingmenu.ArticleFragment$PlaceholderFragment" >
<WebView android:id="@+id/webPage"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
设置可见性:
spinner = (ProgressBar)getActivity().findViewById(R.id.progressBar1);
spinner.setVisibility(View.VISIBLE);
spinner.setVisibility(View.GONE);
Run Code Online (Sandbox Code Playgroud)
以与前一代码相同的方式设置可见性,但由于某种原因,这不是设置ProgressBar
为GONE
.不确定是什么问题.
我尝试使用Android中的clearAnimation
建议,setVisbility在RelativeLayout中不起作用 …
我正在尝试测试FullCalendar
(版本2.2.6)addEventSource
$('button').click(function() {
$("#calendar").fullCalendar('removeEventSource', cal_events_1);
$("#calendar").fullCalendar('addEventSource', cal_events_2);
});
Run Code Online (Sandbox Code Playgroud)
但我总是收到这个错误:
Uncaught TypeError: Cannot read property 'hasTime' of undefined
Run Code Online (Sandbox Code Playgroud)
两个源都是硬编码的,并且加载日历时,任一源都会成功加载事件,因此没有日期不正确.
var cal_events_1 = [
{
events: [
{
title: 'event 1',
start: '2015-01-04',
color: 'tomato'
},
{
title: 'event 2',
start: '2015-01-09'
}],
color: '#55B2DA',
textColor: '#3c3c3c'
},
{
events: [
{
title: 'event 3',
start: '2015-01-06'
},
{
title: 'event 4',
start: '2015-01-07'
}],
color: 'rgb(255, 162, 71)',
textColor: '#3c3c3c'
},
{
events: [
{
title: 'event 5', …
Run Code Online (Sandbox Code Playgroud) 我知道这一定要问过一百次,但我一直在尝试一些我能找到的解决方案,但似乎都没有.
我有一个shortcode
包装内容:
[important_note]Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam vel velit at ex congue aliquet.[/important_note]
Run Code Online (Sandbox Code Playgroud)
我正在使用以下短代码功能functions.php
:
function important_note( $atts, $content = null ) {
return '<div class="imp-note">'.$content.'</div>';
}
add_shortcode("important_note", "important_note");
Run Code Online (Sandbox Code Playgroud)
这是生成的html代码:
<div class="imp-note">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<p></p>
<p>Nam vel velit at ex congue aliquet.</p>
</div>
Run Code Online (Sandbox Code Playgroud)
主要问题是<p>
我一直试图使用这里提到的解决方案来解决这个问题:通过php functon和Github 从wordpress短代码中删除空<p>标签然而这似乎解决了<p>
包装shortcode
不是内容的问题shortcode
.
第一行没有任何<p>
包装也有点奇怪,这让我觉得我应该在短代码函数中添加代码?
在此先感谢您的帮助.
UPDATE
好的,所以这段代码看起来像是诀窍:
remove_filter( 'the_content', 'wpautop' …
Run Code Online (Sandbox Code Playgroud) 我一直在关注这个教程,有一个幻灯片菜单.我添加了一个TableViewController,它将显示文章列表.由于某种原因,viewDidLoad
没有开火.
在本教程中SideViewController
,控制将显示哪个控制器,如果具有segue
标识符"showPhoto",它将加载特定图像.
// Set the photo if it navigates to the PhotoView
if ([segue.identifier isEqualToString:@"showPhoto"]) {
PhotoViewController *photoController = (PhotoViewController*)segue.destinationViewController;
NSString *photoFilename = [NSString stringWithFormat:@"%@_photo.jpg", [menuItems objectAtIndex:indexPath.row]];
photoController.photoFilename = photoFilename;
}
Run Code Online (Sandbox Code Playgroud)
我想为重新创建同样的东西,TableViewController
并尝试强制viewDidLoad
控制器,如此处所示强制viewDidLoad在iOS上触发,但它仍然无法正常工作:
if ([segue.identifier isEqualToString:@"showList"]) {
TableViewController *tableController = (TableViewController*)segue.destinationViewController;
[tableController view];
}
Run Code Online (Sandbox Code Playgroud)
TableViewController viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
// Change button color
_sidebarButton.tintColor = [UIColor colorWithWhite:0.1f alpha:0.9f];
// Set the side bar button action. …
Run Code Online (Sandbox Code Playgroud) 我正在尝试点击隐藏的输入file
.我在这里测试过,它工作正常.
在实际项目中,我收到此错误Uncaught RangeError: Maximum call stack size exceeded
.
这就是我所拥有的:
HTML:
<div id="upload-image-container" class="upload-image-container inline-block">
<h2 class="inline-block">+ Upload Your Photo!</h2>
<input type="file" name="images" id="images" />
</div>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
jQuery("#upload-image-container").click(function() {
// e.preventDefault();
jQuery("input[type='file']").click();
});
Run Code Online (Sandbox Code Playgroud)
我试过添加e.preventDefult
或者e.preventImmediatePropagation
我仍然遇到同样的错误.
不知道我怎么能真正解决这个问题.
我在file
输入上有一个监听器......图像会自动上传.不确定是否是造成问题的原因.我尝试删除它,我得到了相同的结果.
input.addEventListener("change", function (evt) {
var i = 0, len = this.files.length, img, reader, file;
for ( ; i < len; i++ ) {
file = this.files[i];
if (!!file.type.match(/image.*/)) {
if ( …
Run Code Online (Sandbox Code Playgroud) 我正在通过php创建一个Facebook应用程序.我使用以下代码为用户添加应用程序:
$config = array();
$config['appId'] = '532241193565136';
$config['secret'] = '19de17575ad3d245c8cc32f5b623e310';
$config['cookie'] = true;
$config['fileUpload'] = true; // optional
$fb = new Facebook($config);
$user = $fb->getUser();
$loginUrl = $fb->getLoginUrl(
array(
'scope' => 'publish_actions'
)
);
Run Code Online (Sandbox Code Playgroud)
这应该允许用户通过应用程序发布到Facebook.我遇到的问题是权限弹出窗口不允许用户选择发布权限的类型 - 公共,自定义,只有我等我总是得到This does not let the app post to Facebook
帖子正被添加到Facebook页面,但显然他们对添加帖子的用户是私密的.
不知道我在这里遗失了什么......
更新:
我已经尝试删除应用程序并添加新的,但没有任何区别.
更新2:
我刚尝试使用该页面管理员用户的应用程序...The following permissions have not been approved for use and are not being shown to people using your app: publish_actions
信息更新:
万一有人偶然发现这个问题.Facebook的审查指南指出"审核时间估计范围为7至14个工作日." 考虑这些延迟总是很重要:)
我正在尝试使用React,我正在尝试创建一个搜索来过滤项目列表.我有两个组件,主要显示调用搜索组件的项目列表.
我有一个onChange
函数,它将term
状态设置为输入值,然后searchItems
从主组件调用以过滤项目列表.出于某种原因searchItems
,this.state
未定义.我想加入bind
到onInputChange
在搜索组件将整理出来,但它并没有任何区别.也许有一些我想念的东西.
主要部分
import React, { Component } from 'react';
import _ from 'lodash';
import Search from './search';
class Items extends Component {
constructor(props) {
super(props);
this.state = {
error: null,
isLoaded: false,
items: []
};
}
componentDidMount() {
fetch("[url].json")
.then(res => res.json())
.then(
(result) => {
this.setState({
isLoaded: true,
items: result
});
}
),
(error) => {
this.setState({
isLoaded: true,
error
})
}
}
searchItems(term) …
Run Code Online (Sandbox Code Playgroud) javascript ×3
css ×2
html ×2
jquery ×2
php ×2
android ×1
css3 ×1
facebook ×1
file-upload ×1
flexbox ×1
fullcalendar ×1
ios ×1
objective-c ×1
progress-bar ×1
reactjs ×1
shortcode ×1
uitableview ×1
viewdidload ×1
wordpress ×1