android-layout

Scrollable vertically and horizontally EditText that doesn't automatically break text to the next line

烂漫一生 提交于 2020-01-20 08:59:07
问题 I need an activity that look like a simple text editor: full-screen EditText with submit button below it. Important: 1. EditText has to scroll both vertically and horizontally 2. Input text goes to the next line ONLY when the user clicks nextline button 3. EditText fills the whole space between the top of the screen and the button My code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

How to keep expanded SearchView on the right side of ActionBar (while using custom icon)?

丶灬走出姿态 提交于 2020-01-20 04:58:04
问题 My question is closely related to SearchView wrong alignment and SearchView positions when expanded in ActionBar but the answers posted there do not work. So, I'm using a SearchView in the Action Bar: <item android:id="@+id/action_search" android:icon="@drawable/navi_search" android:title="@string/action_search" android:showAsAction="ifRoom|collapseActionView" android:actionViewClass="android.widget.SearchView" /> It looks like this by default (top-right corner, next to overflow menu):

Scrollview doesn't scroll to the margin at the bottom

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-20 03:50:28
问题 I have a simple layout as follows : <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#D23456" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="#FFFFFF" > <ImageView android:layout_width="match_parent" android:layout_height="800dp" android:src="@drawable/ic_launcher" /> </LinearLayout> <

FragmentTabHost graphical layout doesn't render

你。 提交于 2020-01-20 02:08:28
问题 The graphical layout for a simple android.support.v4.app.FragmentTabHost never renders in either Eclipse or Android Studio. The Console error I get is consistently: Exception raised during rendering: No tab known for tag null I'm using the most basic XML file: <android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android

Add layout with parameters programmatically Android

只谈情不闲聊 提交于 2020-01-19 09:52:51
问题 Hello I have a main screen. <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=".MainActivity" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> <ImageButton android:id="@+id/imageButton1" android:layout_width="55dp" android

Add layout with parameters programmatically Android

不想你离开。 提交于 2020-01-19 09:51:08
问题 Hello I have a main screen. <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=".MainActivity" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> <ImageButton android:id="@+id/imageButton1" android:layout_width="55dp" android

Android WebView not loading URL

不问归期 提交于 2020-01-19 07:10:18
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

Android WebView not loading URL

谁都会走 提交于 2020-01-19 07:06:33
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

Android WebView not loading URL

时光总嘲笑我的痴心妄想 提交于 2020-01-19 07:04:06
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

Fab in Lollipop shows strange shadow on long press

自古美人都是妖i 提交于 2020-01-17 08:21:47
问题 I am using the FloatingActionButton in a CoordinatorLayout: <android.support.design.widget.FloatingActionButton android:id="@+id/fab_add" android:layout_width="wrap_content" android:layout_height="wrap_content" android:tint="@color/white" app:fabSize="normal" app:layout_anchor="@+id/view_pager_imageformat_carousel" app:layout_anchorGravity="bottom|end" app:srcCompat="@drawable/ic_playlist_add_black_24dp" app:useCompatPadding="true" /> and it works fine with most Android Apis, but in Android 5