我在textarea上使用ckeditor但我无法从中获取数据.
代码:
<textarea name="DSC" class="materialize-textarea"></textarea>
<script>
CKEDITOR.replace('DSC');
</script>
Run Code Online (Sandbox Code Playgroud)
Jquery:
var title = $('input[name=TITLE]').val();
var desc = $('textarea[name=DSC]').text();
var formdata = 'TITLE='+title+'&DSC='+desc;
Run Code Online (Sandbox Code Playgroud) 我想使用RecyclerView显示记录列表.
但是当我运行应用程序时,它只显示一条记录.
我验证了我的代码,一切似乎都很好.
适配器代码:
public class AdapterData extends RecyclerView.Adapter<AdapterData.DummyHolder> {
private LayoutInflater layoutInflater;
private ArrayList<String> mItems = new ArrayList<>();
public Context ThisContext;
public AdapterData(Context context)
{
layoutInflater = LayoutInflater.from(context);
mItems = generateValues();
ThisContext = context;
}
public static ArrayList<String> generateValues(){
ArrayList<String> Dummy = new ArrayList<>();
for(int i=1; i<100; i++)
{
Dummy.add("Item"+i);
Log.d("MTS", String.valueOf(i));
}
return Dummy;
}
@Override
public DummyHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= layoutInflater.inflate(R.layout.row_layout,parent,false);
DummyHolder holder=new DummyHolder(view);
return holder;
}
@Override
public void onBindViewHolder(DummyHolder holder, int …Run Code Online (Sandbox Code Playgroud) 我是Asp.Net的新手
我已经在我的Windows系统上启用了IIS 7的功能,并且能够看到IIS管理器.
我创建了一个应用程序,但通过visual studio构建/运行应用程序,它进入浏览器并使用不同的端口号运行应用程序.当我通过visual studio停止构建/运行应用程序时,我再次刷新浏览器应用程序无法运行.
我想在没有visual studio的情况下运行应用程序.这该怎么做.
它给出了这个: http://localhost:9864/
我在style.xml上添加了colorPrimaryDark,但状态栏android v21上没有颜色受到影响.
我有一个自定义工具栏,我在style.xml代码中没有使用操作栏主题
如有任何解决方案请帮帮我?
样式代码: -
<style name="AppTheme" parent="AppTheme.Base">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="myCustomToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorSecondary">@color/colorAccent</item>
</style>
Run Code Online (Sandbox Code Playgroud)
风格v21: -
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:colorAccent">@color/colorAccent</item>
<item name="windowActionBar">true</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
Run Code Online (Sandbox Code Playgroud)
工具栏代码: -
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:elevation="4dp"
android:background="@color/colorPrimary"
android:popupTheme="@style/Base.ThemeOverlay.AppCompat.Light"
xmlns:android="http://schemas.android.com/apk/res/android" />
Run Code Online (Sandbox Code Playgroud)
主要布局代码
<android.support.design.widget.CoordinatorLayout 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=".MainActivity">
<LinearLayout
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<include layout="@layout/custom_toolbar"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" …Run Code Online (Sandbox Code Playgroud) 我使用RecyclerView和CardView从网站获取教程创建了一个基本应用程序.
应用程序工作正常,我有一些困惑.(我在这里显示我的整个代码)
混淆是代码如何逐步运作.所以请清楚我的概念.
我的应用程序的基本结构:
row_data_layout要绑定的xml文件recycler_view.RecyclerView的MainActivity文件row_data_layout.xml 档案:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/CardView"
android:paddingBottom="16dp"
android:layout_marginBottom="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)
数据类文件:
public class Data {
public String Name;
Data(String Name)
{
this.Name=Name;
}
}
Run Code Online (Sandbox Code Playgroud)
Data_Adapter类文件:
public class Data_Adapter extends RecyclerView.Adapter<Data_Adapter.View_holder> {
List<Data> list = Collections.emptyList();
Context context;
public Data_Adapter(List<Data> list, Context context) {
this.list = list;
this.context …Run Code Online (Sandbox Code Playgroud) 应用程序在几秒钟后自动注销,我想将其增加到30分钟.
我在web.config文件中完成了一些代码,但它不起作用.我已经研究了很多文章,但我无法解决它.
Web.config代码:
<sessionState mode="InProc" timeout="1800"></sessionState>
<authentication mode="Forms">
<forms loginUrl="~/Login" timeout="1800">
</forms>
</authentication>
Run Code Online (Sandbox Code Playgroud) 我有一个注册表,想要检查注册用户是否会再次注册以显示已使用ajax功能注册的警报窗口.
我使用了codeigniter框架.
我的功能正常工作,但当警报弹出并按下确定页面重新加载.我想禁用
我的表格代码:
<form class="modal-content" name="form2" action="<?= $this->config->base_url();?>home/register_user" method="post" onSubmit="return ValidateRegister()">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Create your account</h4>
</div>
<div class="page-content vertical-align-middle" style="display:block;">
<div class="form-group has-error">
<label class="control-label" for="inputTokenfieldError-tokenfield"> <?php echo validation_errors(); ?></label>
</div>
<div class="form-group form-material floating">
<input type="text" class="form-control " id="inputName" name="username" value="<?php echo set_value('username'); ?>" autocomplete="off">
<label class="floating-label">Username</label>
</div>
<div class="form-group form-material floating">
<input type="email" class="form-control " id="my_email" name="email" value="<?php echo set_value('email'); ?>" autocomplete="off">
<label …Run Code Online (Sandbox Code Playgroud) 我想在Google Map API中隐藏InfoBox Window的关闭按钮,但我不知道如何做到这一点.
CSS代码:
#infobox {
padding: 0 0 8px 0;
margin: -95px 0 0 -15px;
min-width: 180px;
margin-top: 8px;
color: rgb(94, 94, 94);
font-family: Gotham SSm A,Gotham SSm B,Halvetica,sans-serif;
font-size: 12px;
z-index: 1000;
transition: box-shadow .25s;
padding: 1px;
font-size: 12px;
background-color: #ce93d8;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: 0 0 8px #9c27b0;
box-shadow: 0 0 8px #9c27b0;
}
Run Code Online (Sandbox Code Playgroud)
JavaScript代码:
infobox = new InfoBox({
disableAutoPan: false,
maxWidth: 150,
pixelOffset: new google.maps.Size(-140, 0),
zIndex: null,
boxStyle: {
background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') …Run Code Online (Sandbox Code Playgroud) 我在控制器文件夹的子文件夹中创建了一个控制器,在子文件夹中我创建了一个登录控制器.
但我无法访问此控制器并已在路径文件中给出规则.
结构体 :
Controller
--admin
---login.php
Run Code Online (Sandbox Code Playgroud)
路线规则:
$route['default_controller'] = 'admin/login';
$route['admin_login'] = 'admin/login';
Run Code Online (Sandbox Code Playgroud) 我有联系人列表,我已使用CardView在RecyclerView上显示此列表.
列表显示完美但现在我想制作可点击的卡片视图.因此,当我点击特定联系人时,我将显示特定联系人的详细信息.
列表完美显示,但当我点击特定联系人点击事件不起作用.
我还在ContactAdapter类的CardView和OnClickListener事件上使用了clickable true.
我做了什么 :
我有三个布局activity_main,contact_list,contact_detail.
在activity_main中,我使用了recycler_view.在contact_list中,我使用了card_view并将其与recycler视图绑定.
我有三个java类:Contact - 我在其中使用getter和setter定义变量ContactAdapter - 我获取联系人并将其与卡片视图绑定.MainActivity - 我获取所有联系人并在回收站视图中显示它.
activity_main布局代码:
<android.support.v7.widget.RecyclerView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/recycler_view">
</android.support.v7.widget.RecyclerView>
Run Code Online (Sandbox Code Playgroud)
contact_list_layout代码:
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/card_view"
android:clickable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remo"
android:id="@+id/person_name"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/person_name"
android:text="example@gmail.com"
android:id="@+id/person_email"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)
Java类代码:
主要活动代码:
RecyclerView recyclerView;
RecyclerView.Adapter adapter;
RecyclerView.LayoutManager layoutManager;
String[] name,email;
ArrayList<Contact> list = new ArrayList<Contact>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
name = getResources().getStringArray(R.array.person_name);
email = getResources().getStringArray(R.array.person_email);
int count = 0;
for (String …Run Code Online (Sandbox Code Playgroud) android android-adapter onclicklistener android-cardview android-recyclerview
我已经创建了一个工具栏xml文件,并想在MainActivity中添加。
我在MainActivity布局文件中包含了toolbar.xml文件
Toolbar.xml代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/dark_blue">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)
主要活动Xml布局:
<?xml version="1.0" encoding="utf-8"?>
<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="hogwart.harrypotter.bucketdrop.ActivityMain">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"/>
<include layout="@layout/empty_drops"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
然后我想通过Java代码将工具栏添加到主要活动中,但此处显示了一个工具栏:
import android.widget.Toolbar;
Run Code Online (Sandbox Code Playgroud)
但是找不到支持工具栏:
import android.support.v7.widget.Toolbar;
Run Code Online (Sandbox Code Playgroud)
主要活动代码:
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toolbar;
public class ActivityMain extends AppCompatActivity {
Toolbar
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Run Code Online (Sandbox Code Playgroud)
Gradle文件代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "hogwart.harrypotter.bucketdrop"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0" …Run Code Online (Sandbox Code Playgroud) android ×5
javascript ×3
asp.net ×2
codeigniter ×2
jquery ×2
php ×2
adapter ×1
ajax ×1
asp.net-mvc ×1
c# ×1
google-maps ×1
html ×1
iis-7 ×1
java ×1
xml ×1