小编Ahm*_*zal的帖子

适用于全屏模式的Android Studio键盘快捷键

我想进入全屏模式Android Studio.Keyboard Shortcut这样做有没有.Keyboard Shortcut进入和exit全屏模式的关键是什么Android Studio

android keyboard-shortcuts android-fullscreen android-studio android-ide

26
推荐指数
3
解决办法
2万
查看次数

在React Native中取消焦点TextInput

我正在使用React Native构建一个Android应用程序.

如何强制a TextInput"unFocus",这意味着光标在文本字段内闪烁.有对功能isFocused()onFocus(),但实际上,我怎么得到的文本字段放弃焦点.一旦我点击进入,你会认为它会自动完成,但事实并非如此.

   import React, {Component} from 'react';
   import { AppRegistry, Text, View, StyleSheet, TextInput, TouchableOpacity} 
   from 'react-native';

   var SHA256 = require("crypto-js/sha256");

   export default class LoginForm extends Component{


constructor(props){
    super(props);
    this.state = {
        email: '',
        password:''
    };
}

tryLogin = () => {
    if(this.state.email=="email123" && this.state.password == "password"){
        console.log("password verified");
        this.props.navigator.replace({
            title: 'Dashboard'
        });
    }

    console.log(this.state.email);
    console.log(this.state.password);
    console.log("Hash" + SHA256(this.state.password));
}

render(){
    return(
        <View style={styles.container}>
            <TextInput 
                style={styles.input}

                placeholder="Email address" 
                placeholderTextColor="white"
                onChangeText={(email) => this.setState({email})}>
            </TextInput> …
Run Code Online (Sandbox Code Playgroud)

android user-input focus react-native react-native-android

23
推荐指数
5
解决办法
3万
查看次数

Android:CollapsingToolbarLayout中的MapView

我目前正在尝试将Map View(或包含地图的片段)放入CollapsingToolbarLayout。我希望在RecyclerView滚动时对其具有视差效果。不幸的是,它根本没有出现!甚至没有灰色网格!折叠动画正在运行。我到处都在搜索,但是我所能找到的只是关于ImageView,没有其他组件。所以这是我的问题:

  1. 它甚至有可能把任何东西比ImageViewCollapsingToolbarLayout?(文档讨论的是子视图,因此我认为这是可能的)
  2. 如果是这样,是否还允许使用片段?
  3. 那我在做什么错呢?

这是我的xml:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:map="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="300dp">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <android.support.v7.widget.Toolbar
                android:id="@+id/main_activity_toolbar"
                android:layout_height="?attr/actionBarSize"
                android:layout_width="match_parent"
                android:background="?attr/colorPrimary"
                android:layout_alignParentTop="true"
                app:layout_collapseMode="pin"
                app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
            </android.support.v7.widget.Toolbar>

            <com.google.android.gms.maps.MapView
                android:id="@+id/main_activity_mapview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:apiKey="AIzaSyA-kEuKT39QK8eG7iYWriFgsvkrZZz6zNo"
                android:clickable="true"
                app:layout_collapseMode="parallax" />

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/main_rv_list_places"
        android:scrollbars="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

还有我拿回地图的部分。onMapReady永远不会触发。

    if (mMap == null) {

        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.getMapAsync(new OnMapReadyCallback() {
            @Override …
Run Code Online (Sandbox Code Playgroud)

android android-mapview mapfragment android-collapsingtoolbarlayout

5
推荐指数
1
解决办法
3898
查看次数

添加 android:textIsSelectable 导致 TextView 自动滚动

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/solutions"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:lineSpacingMultiplier="1.2"
            android:textAppearance="@style/TextAppearance.AppCompat"
            android:textIsSelectable="true"
            android:textSize="18sp"
            tools:text="1.  1+2+3 = 6"/>
    </HorizontalScrollView>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

android:textIsSelectable="true"添加后TextViewTextView会自动滚动到底部。但是我不想要这种行为。

android scrollview textview android-studio

5
推荐指数
1
解决办法
483
查看次数

如何仅通过单击更改整个应用程序的语言?

Spinner在登录页面上有三种语言选择。我希望当用户选择一种语言时假设“波斯语”整个应用程序的语言应该改变。我只能更改当前的语言Activity。如何更改整个应用程序的语言。

android android-spinner android-activity android-studio

4
推荐指数
2
解决办法
1万
查看次数

将recyclerview的焦点更改为某些项目的位置?

So I have a standard RecyclerView that takes a list of posts and displays them to the user. My problem is when the user comes into the activity, I want to be able to change the focus to a particular post.

Ex. User A sees that he has a notification that of someone has liked his/her post. He/she clicks that notification, and it loads the activity of user's post, and then the focus changes to the position of the post …

android android-layout android-studio android-recyclerview

-1
推荐指数
1
解决办法
1万
查看次数