在Play开发者控制台中,它说:
您的APK似乎不是专为平板电脑设计的
但我添加了layout-sw600dp,layout-sw600dp-land,layout-sw720dp和layout-sw720dp-land文件夹的布局.完整的清单(原样):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.technicosa.unjumble"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar" >
<activity
android:name="com.technicosa.unjumble.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.technicosa.unjumble.UserSettingsActivity"
android:label="@string/title_activity_user_settings" >
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
该应用程序在模拟器中的Nexus 7和Nexus 10上运行完美.同样在开发者控制台的优化提示下,它说:
您的制作APK需要符合以下条件:使用10英寸平板电脑上的可用屏幕空间
我的应用的截图:

虽然应用程序似乎在平板电脑上运行(我只在模拟器上测试过),但必须采取哪些措施来满足Play标准?
使用此样板作为参考,我创建了一个Electron应用程序.它使用webpack捆绑脚本并表达服务器来托管它.
Electron的脚本加载:
mainWindow.loadURL('file://' + __dirname + '/app/index.html');
index.html加载服务器托管的脚本:
<script src="http://localhost:3000/dist/bundle.js"></script>
我运行electron index.js构建应用程序并node server启动使用webpack捆绑脚本的服务器.
它工作正常,我的React组件App已安装.但是我如何将react-router集成到这个中呢?
我以与在浏览器应用程序中相同的方式实现它.我收到此错误:
[react-router] Location "/Users/arjun/Documents/Github/electron-app/app/index.html" did not match any routes
它将文件路径作为路径.通过锅炉板代码没有帮助.我错过了什么?
所以我使用Android设计支持库提供的NavigationView

我似乎无法找到如何设计它的例子.
到目前为止,我有:
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
app:headerLayout="@layout/header"
app:menu="@menu/drawer"
app:itemTextColor="@color/black"
app:itemIconTint="@color/black"/>
Run Code Online (Sandbox Code Playgroud)
样式标题很容易,因为它在自己的xml布局下,但是主体是菜单资源文件而不是布局.
app:itemTextColor 改变文字颜色app:itemIconTint 更改图标颜色app:itemBackground 更改项目背景颜色那么如何设置
android android-support-library material-design navigationview androiddesignsupport
ES6以后我们有const.
这是不允许的:
const x; //declare first
//and then initialize it
if(condition) x = 5;
else x = 10;
Run Code Online (Sandbox Code Playgroud)
这是有道理的,因为它阻止我们在初始化之前使用常量.
但如果我这样做
if(condition)
const x = 5;
else
const x = 10;
Run Code Online (Sandbox Code Playgroud)
x成为块范围.
那么如何有条件地创建一个常量呢?
我正在使用mocha,酶来创建反应组分的单元测试.下面是一个示例组件.
Foo.js
class Foo extends React.Component {
customFunction=() => {
}
render() {
return (<div className={this.props.name}/>);
}
}
Run Code Online (Sandbox Code Playgroud)
这是测试文件.
富-Test.js
import React from 'react';
import { expect } from 'chai';
import { shallow, mount, render } from 'enzyme';
import Foo from '../src/Foo';
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(shallow(<Foo />).contains(<div className="foo" />)).to.equal(true);
});
it("contains spec with an expectation", function() {
expect(shallow(<Foo />).is('.foo')).to.equal(true);
});
});
Run Code Online (Sandbox Code Playgroud)
一切都是好的.但是当我们使用酶时,我不明白如何在Foo.js中对customFunction进行单元测试
我在我的Android应用程序中运行SQLite3数据库.我刚刚从预先填充的数据库中读取了200k行和14列.参赛作品是单词.所有列的数据类型都是文本.查询最多11个字母的单词(例如,ABANDONMENT)工作正常.但对于12或更高(例如,ABANDONMENTS),应用程序崩溃.这是logcat:
Could not allocate CursorWindow '//data//data//com.example.myapp//databases//database.sqlite' of size 2097152 due to error -12.
threadid=11: thread exiting with uncaught exception (group=0x40adf9f0)
FATAL EXCEPTION: Thread-2883
android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=861 (# cursors opened by this proc=861)
at android.database.CursorWindow.<init>(CursorWindow.java:104)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:162)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:161)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:201)
at com.example.myapp.MainActivity.query(MainActivity.java:815)
at com.example.myapp.MainActivity$2.run(MainActivity.java:356)
at java.lang.Thread.run(Thread.java:856)
Run Code Online (Sandbox Code Playgroud)
码:
query = "select * from words where col_1 = \"" + (myWord)+ "\";";
cursor = database.rawQuery(query, null);
if (cursor …Run Code Online (Sandbox Code Playgroud) 说我有课Task和TaskGroup
class Task{
constructor(public text:string){}
}
class TaskGroup {
constructor(public title:string = "new task group", public tasks:Task[] = []){}
}
Run Code Online (Sandbox Code Playgroud)
然后在我的Angular 2服务中,我将创建一个不可变的TaskGroups列表
@Injectable()
class TaskService {
taskGroups:Immutable.List<TaskGroup>;
constructor() {
this.taskGroups = Immutable.List<TaskGroup>([new TaskGroup("Coding tasks")]);
}
}
Run Code Online (Sandbox Code Playgroud)
这样只有taskGroups List是不可变的.不管里面是什么都不是.即使我Immutable.fromJS(...)而不是Immutable.List<Board>(...)嵌套对象都是普通的'Javascript对象.
不可变的JS不会假定类继承(使用ES6#562继承自Immutable对象)
//can't do this!
class TaskGroup extends Immutable.Map<string, any>{
constructor(public title:string = "new task group", public tasks:Task[]){}
}
//it complained about the class not having methods like set, delete etc
Run Code Online (Sandbox Code Playgroud)
那么如何创建Immutable类对象呢?
这也适用于新项目!
gen文件夹为空.activity_main.xml文件中没有错误.
我试过了:
但仍然gen文件夹是空的!救命!
在我的应用程序中,我有一个包含属性的编辑文本:
android:inputType="none"和android:textIsSelectable="true".
这是因为我已经定义了自己的按钮来输入输入(按钮,而不是自定义键盘).我用过
editText.requestFocus()
使光标可见.到Android 4.0.4,光标是可见的,而不是在运行Jelly Bean的手机中.光标不可见但我可以触摸并在字符之间输入文本(使用editText.getSelectionStart()).
果冻豆有什么变化?如何使光标可见?
编辑:
android:cursorVisible="true"没有帮助.
Typescript 1.8现在支持无类型的JS文件.要启用此功能,只需添加编译器标志--allowJs或将"allowJs":true添加到tsconfig.json中的compilerOptions
通过https://blogs.msdn.microsoft.com/typescript/2016/01/28/announcing-typescript-1-8-beta/
我正在尝试导入没有打字文件的react-tap-event-plugin.
import * as injectTapEventPlugin from 'injectTapEventPlugin';
Run Code Online (Sandbox Code Playgroud)
说找不到模块.所以我试过:
import * as injectTapEventPlugin from '../node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js';
Run Code Online (Sandbox Code Playgroud)
这表示模块解析为非模块实体,无法使用此结构导入.然后我尝试了:
import injectTapEventPlugin = require('../node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js');
Run Code Online (Sandbox Code Playgroud)
它与崩溃ERROR in ./scripts/index.tsx
Module build failed: TypeError: Cannot read property 'kind' of undefined的node_modules/typescript/lib/typescript.js:39567
我的tsconfig:
{
"compilerOptions": {
"target": "ES5",
"removeComments": true,
"jsx": "react",
"module": "commonjs",
"sourceMap": true,
"allowJs": true
},
"exclude": [
"node_modules"
]
}
Run Code Online (Sandbox Code Playgroud)
我正在使用带有ts-loader的webpack:
{
test: /\.tsx?$/,
exclude: ['node_modules', 'tests'],
loader: 'ts-loader'
}
Run Code Online (Sandbox Code Playgroud) android ×5
javascript ×4
ecmascript-6 ×3
reactjs ×2
typescript ×2
angular ×1
constants ×1
cursor ×1
database ×1
eclipse ×1
electron ×1
enzyme ×1
google-play ×1
immutable.js ×1
java ×1
node-modules ×1
react-router ×1
sql ×1
sqlite ×1
tablet ×1
ts-loader ×1