这可能听起来很简单但是:我们怎样才能在一个多线可编辑的文本字段中颤动?TextField仅适用于单行.
编辑:一些精确因为看起来不太清楚.虽然您可以设置多行来虚拟包装文本内容,但它仍然不是多行的.它是一行显示为多行.如果你想做点什么
喜欢
这个.
那么你不能.因为您无权访问"输入"按钮.没有输入按钮,没有多行.
我想通过000webhost.com创建一个数据库.每当我从android studio运行应用程序时,我都会在事件日志中显示此消息.有谁知道如何解决这个问题?非常感激!
我的方法有问题
@Override
public boolean onTouchEvent(MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
Run Code Online (Sandbox Code Playgroud)
是更新的.任何想法为什么会这样?我正在构建一个google的api 4.0.3应用程序,我正在尝试为我的viewFliper启用滑动.但是,如果触摸更新,它就无法工作.
BTW:
public class MainActivity extends SherlockMapActivity implements ActionBar.TabListener {
Run Code Online (Sandbox Code Playgroud)
那是我活动的宣言.并检测我实施的滑动:
SimpleOnGestureListener simpleOnGestureListener = new SimpleOnGestureListener(){
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) {
float sensitvity = 50;
if((e1.getX() - e2.getX()) > sensitvity){
SwipeLeft();
}else if((e2.getX() - e1.getX()) > sensitvity){
SwipeRight();
}
return true;
}
};
GestureDetector gestureDetector= new GestureDetector(simpleOnGestureListener);
Run Code Online (Sandbox Code Playgroud)
感谢你!
编辑:
main.xml中:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<ViewFlipper
android:id="@+id/ViewFlipper"
android:layout_width="fill_parent" …
Run Code Online (Sandbox Code Playgroud) 我曾经sh <(curl -L https://nixos.org/nix/install) --daemon
安装过 Nix。\n安装完成后运行nix-shell -p nix-info --run "nix-info -m"
以验证安装。\n它返回以下错误
warning: Nix search path entry \'/nix/var/nix/profiles/per-user/kana/channels\' does not exist, ignoring\nerror: file \'nixpkgs\' was not found in the Nix search path (add it using $NIX_PATH or -I)\n\n at \xc2\xabstring\xc2\xbb:1:25:\n\n 1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nix-info) ]; } ""\n | ^\n(use \'--show-trace\' to show detailed location information)\n
Run Code Online (Sandbox Code Playgroud)\n 因为这个错误无法编译我的android项目.
/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java
Error:(32, 39) error: package com.google.android.gms.appstate does not exist
Error:(293, 28) error: cannot find symbol variable AppStateManager
Error:(294, 30) error: cannot find symbol variable AppStateManager
Error:Execution failed for task ':BaseGameUtils:compileReleaseJava'.
Run Code Online (Sandbox Code Playgroud)
编译失败; 请参阅编译器错误输出以获取详细信 信息:建筑失败
我的gradle ..
apply plugin:
'android-library' repositories
{
mavenCentral()
}
buildscript
{
repositories
{
mavenCentral()
}
dependencies
{
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
dependencies
{
compile 'com.android.support:appcompat-v7:20.0.+'
compile 'com.android.support:support-v4:20.0.+'
compile 'com.google.android.gms:play-services:+'
}
android
{
compileSdkVersion 21
buildToolsVersion '21.0.0'
defaultConfig
{
minSdkVersion 14
targetSdkVersion 23
}
productFlavors { } …
Run Code Online (Sandbox Code Playgroud) 从Playstore更新应用程序时我收到错误..
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available 09-02 17:10:03.586 11866-12008/? W/System.err: java.lang.ClassNotFoundException: android.net.ZeroBalanceHelper 09-02 17:10:03.586 11866-12008/? W/System.err: at java.lang.Class.classForName(Native Method) 09-02 17:10:03.587 11866-12008/? W/System.err: at java.lang.Class.forName(Class.java:324) 09-02 17:10:03.587 11866-12008/? W/System.err: at java.lang.Class.forName(Class.java:285) 09-02 17:10:03.587 11866-12008/? W/System.err: at
com.android.okhttp.internal.http.ZeroBalanceHelperClass.getFeatureFlagValue(ZeroBalanceHelperClass.java:39)
09-02 17:10:03.587 11866-12008/? W/System.err: at
com.android.okhttp.internal.http.HttpEngine.followUpRequest(HttpEngine.java:1090)
09-02 17:10:03.588 11866-12008/? W/System.err: at
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:393)
09-02 17:10:03.588 11866-12008/? W/System.err: at
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
09-02 17:10:03.588 11866-12008/? W/System.err: at
com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
09-02 17:10:03.588 11866-12008/? W/System.err: at
com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
09-02 17:10:03.588 11866-12008/? …
Run Code Online (Sandbox Code Playgroud) 我的布局中有简单的imageview,我有一个api,它给了我一个图像网址.我在我的布局中集成了数据绑定.现在解析了api后,我正在通过这条线设置模型binding.setUserinfo(memberObj.getMemberdata());
现在我还有一个绑定适配器,其中编写了imgurl代码.现在,自定义绑定适配器在活动开始时和解析api后调用两次.
现在我想在成功解析api之后通知UI.
这是我的xml activity_main.xml代码:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data class="MainBinding">
<variable
name="userinfo"
type="com.myapplication.retrofit.pojo.ImgTest"/>
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.myapplication.retrofit.MainActivity">
<ImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:id="@+id/imageView"
app:image_url="@{userinfo.imgUrl}"
/>
</RelativeLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)
这是我的Pojo:ImgTest.java
public class ImgTest extends BaseObservable {
String imgUrl;
@Bindable
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
notifyPropertyChanged(BR.imgUrl);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的CustomBinder.java
public class CustomBinders {
private static final String TAG = "CustomBinders";
@BindingAdapter({"image_url"})
public static void loadImageWithOUtProgressBar(ImageView view, …
Run Code Online (Sandbox Code Playgroud) java.io.IOException: 无法从 android/accounts/annotations.xml 解析 XML
任何人都可以帮助解决上述错误?
我WebView
在应用程序中使用加载网址。我想要的功能是检测视频并获取 url(如果网络视图中正在播放任何视频)。
我已经使用WebViewClient
过并且shouldOverrideUrlLoading(WebView view, String url)
网页视图代码
webview = findViewById(R.id.webview);
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webview.getSettings().setPluginState(WebSettings.PluginState.ON);
webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setDisplayZoomControls(true);
webview.getSettings().setDomStorageEnabled(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.setWebViewClient(new MyWebViewClient());
webview.loadUrl("https://www.google.com/");
Run Code Online (Sandbox Code Playgroud)
WebView客户端代码
private class MyWebViewClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("youtube") && !url.contains("-youtube")) {
Toast.makeText(context, "This is youtube url", Toast.LENGTH_SHORT).show(); …
Run Code Online (Sandbox Code Playgroud) android ×8
app-update ×1
charts ×1
dart ×1
data-binding ×1
flutter ×1
installation ×1
java ×1
nix ×1
nixos ×1
nixpkgs ×1
swipe ×1
touch-event ×1
ubuntu ×1