android-xml

How to stop main content re-sizing of umano AndroidSlidingUpPanel when panel is set to default panel height

南楼画角 提交于 2019-12-05 15:48:39
I am using umano AndroidSlidingUpPanel in my Android project. Here I am using Google Map as my main content. Follow is the relevant XML file. <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=".DemoActivity" > <com.mypkg.name.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom"

How to get distance from the View to a phone bottom?

半腔热情 提交于 2019-12-05 15:35:41
If I have a certain View on the layout ( ImageView , for example), is it possible to find the distance from the bottom border of the View to the bottom of the phone screen? Thanks. Omar Abdan // instantiate DisplayMetrics DisplayMetrics dm = new DisplayMetrics(); // fill dm with data from current display getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); // loc will hold the coordinates of your view int[] loc = new int[2]; // fill loc with the coordinates of your view (loc[0] = x, looc[1] = y) yourImageView.getLocationOnScreen(loc); // calculate the distance from the TOP(its

How to achieve Android UI like this image layout? About android:clipChildren

有些话、适合烂在心里 提交于 2019-12-05 11:22:24
What I want to achieve is like this layout: I have tried to use this code, to achieve like that image, but unfortunately, I failed. This is the snippet of my code: <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:clipChildren="false" > <RelativeLayout android:id="@+id/text_area_third" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/round_corner_background" android:focusable="false" android:paddingBottom="5dp" android:paddingLeft="5dp" android:paddingRight="5dp

Rendering issue in XML preview : Unable to locate mode 0 [duplicate]

自作多情 提交于 2019-12-05 11:19:21
问题 This question already has answers here : Exception raised during rendering: Unable to locate mode 0 (6 answers) Closed 3 years ago . After updating the android studio exception occured during rendering. Exception raised during rendering: Unable to locate mode 0 java.lang.IllegalStateException: Unable to locate mode 0 at android.view.DisplayInfo.findMode(DisplayInfo.java:458) at android.view.DisplayInfo.getMode(DisplayInfo.java:445) at android.view.Display.getRefreshRate(Display.java:648) at

error:no resource identifier found for attribute“showAsAction” in package android

不打扰是莪最后的温柔 提交于 2019-12-05 10:47:38
I've been working on an Android project and encountered an error which I'm unable to solve for quite a while. Here is the error which says error:no resource identifier found for attribute"showAsAction" in package android and the error is in following file login_.xml <item android:id="@+id/action_settings" android:orderInCategory="100" android:showAsAction="never" android:title="@string/action_settings"/> This attribute is introduced in API level 11. Check the min and target version of your app in Manifest file. Dhanesh "ShowAsAction" attribute is introduced in api 11. Change the minSdkVersion

Is there a way to use a variable ad banner size?

纵饮孤独 提交于 2019-12-05 10:45:43
I'm using Android MOB, and I'd like to use different sizes of banners, especially for the larger screen sizes. I'm using XML code to do so. Is there a way I can use XML to make it work? I'd like to use XML so I can just put it as a standard part of my styles for each of the screen sizes. Thanks! Sample XML Code: <com.google.ads.AdView android:id="@+id/adView" ads:loadAdOnCreate="true" ads:adSize="BANNER" ads:adUnitId="@string/admob_unit_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" ></com.google.ads.AdView> Visit http:/

XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0

纵然是瞬间 提交于 2019-12-05 09:40:14
问题 This is a follow up question to this question: Update Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0 I also updated the support library to 23.2 and started getting the error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0 That question solved it for Android Studio and Gradle. How can this be solved when using Eclipse without Gradle? 回答1: You can either switch back to

layout_weight does not work when the layout inside a ScrollView is larger than the ScrollView

喜夏-厌秋 提交于 2019-12-05 09:14:14
问题 I'm trying to use a linear layout's layout_weight for the height inside of a scrollview. However I find that layout_weight would only work with fillViewPort=true and if there is enough remaining space for the linear_weight to expand. I have listed three examples below and I want to make textView the same size in #2 and #3 as #1 in xml level. As you can see in the link, in #2, #3, textView was automatically changed. Here are my examples. The TextViews and Buttons are enclosed inside of a

Sliding animation having multiple views synchronization issue

左心房为你撑大大i 提交于 2019-12-05 08:27:52
I am trying to make an animation with two textviews. Both are in a relative layout. The functionality of the animation is left textview will go little bit left and at the same time right textview will also go little bit left. I have tried: http://nineoldandroids.com/ and default way. But for both case I am getting a gap during the process. I already put one question but i am not getting any positive reply: Android slider animation is not synchronized Nineoldandroids code: xml file: <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation=

How do I force eclipse to show xml layouts and styles as text?

十年热恋 提交于 2019-12-05 08:24:46
I recently moved up to Eclipse 4.2 (Juno) with ADT 20.0.3. If I view a layout or a style from an old project Eclipse just shows me its appropriate controls-based editor. I want to edit the syntax-highlighted xml text. I don't see a way to switch the plugin's editor to this mode although it will fallback to it for a layout it chokes on and can't give a WYSIWYG display for. Any help will be appreciated. EDIT : This problem turned out to be a side effect of my recent adventures in themeing Eclipse 4.2 . Using the Dark Juno theme, the buttons for switching between text and wysiwyg views at the