android-xml

Xamarin, Visual Studio 2015 - AXML Designer loading forever

丶灬走出姿态 提交于 2019-12-05 06:20:56
问题 I try to edit an axml file in Visual Studio, because drag and drop doesn't work in Xamarin Studio. But when I open my axml file, it's loading forever. I've been waiting for more than 10 minutes, but it is still loading. When I restart VS I can open the axml file without any problems. The same applies for all my other axml files (in other projects). Does anyone knows how to fix this? I'm using the newest stable version(cycle 8) of Xamarin btw. EDIT: I'm using Visual Studio Community 2015

How to have badge icon at corner of a layout

*爱你&永不变心* 提交于 2019-12-05 06:07:02
I wanted to have a badge at corner of a layout . I managed to get badge inside the layout but not able to achieve at corner of it . Currently my code gives me : What i want : i want to have this badge to over right top corner of an layout . I want something like this : Toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height"

Create android buttons programmatically using XML layout as template

落爺英雄遲暮 提交于 2019-12-05 04:43:06
I have a LinearLayout that contains a TextView, and always will. There will also always be at least one button located below the TextView, but there might be more than one under certain circumstances. I can successfully create and add as many buttons as I need programmatically. I can also successfully set whatever appearance related parameters/options that I require for these buttons programmatically. The problem is that I don't know how to tell a programmatically created button that it should use a XML resource file, which contains the appearance and layout parameters, instead of setting

Why is the Fragment element in Android layout written with a lower case 'f'?

陌路散爱 提交于 2019-12-05 03:27:20
All other elements start with an upper case letter, like RelativeLayout, TextView, etc. Is there a particular reason why the Fragment element is always used as <fragment ... /> instead of <Fragment ... /> ? PearsonArtPhoto Fragments when defined in XML aren't actually views. The full view name is specified, or it assumes android.view for the package and finds the rest. But a fragment is only truly specified when it includes the android:name tag. It acts like a keyword, which are typically written in lower case. Thus, Fragment refers to the class, and fragment is the placeholder in XML for

Instantiating an inner class (Preference) in xml file

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:13:05
When you want to access a custom view in some layout.xml file, you have two options: The view is in it's own class. Then you do <package.name.MyView android:layout_width= ... /> The view is an inner class: <view class="package.name.OuterClass$MyView" android:layout_width= ... /> Now I want to do the same thing inside a <PreferenceScreen> . The first way works well, but I would like to put all the custom Preference classes together in my PreferenceActivity. I tried <Preference class="package.name.OuterClass$MyPreference" ... /> (also with '.' instead of '$') as well as <package.name.OuterClass

android: how to add children from an xml layout into a custom view

不羁岁月 提交于 2019-12-05 01:55:56
In my xml layouts I have a custom view in which i will put some children like: <com.proj.layouts.components.ScrollLayout android:id="@+id/slBody" android:layout_width="700dp" android:layout_height="400dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child1"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child2"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child3"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap

EditText input type textCapSentences not working on Lollipop

你离开我真会死。 提交于 2019-12-05 01:19:55
I have implemeted android:inputType="textAutoComplete|textCapSentences" in my xml code. When I run it on kitkat , textCapSentence works fine but when build is run on Lollipop device it does not work. Anybody knows how to solve it. Hi this is because in lollipop if you have disabled Auto - Capitalization in keyboard settings then you can't enable it programmatically. here are the steps:- Tap icon of ‘Settings’ on the Home screen of your Android Lollipop Device At the ‘Settings’ screen, scroll down to the PERSONAL section and tap the ‘Language & input’ section. At the ‘Language & input’ section,

EditText - Gap between text and EditText's line

寵の児 提交于 2019-12-04 23:52:14
When I insert text to my EditText field the text has an abnormal gap between itself and the EditText 's line. Here's a printscreen from my terminal where you can see this gap I'm talking about, it is marked in red. I've played around with text alignment and gravity but to no success. Here's the XML: <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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal

Android File Provider Illegal Argument Exception

元气小坏坏 提交于 2019-12-04 23:35:44
I am using file provider to save photo to a given destination. I get: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data while trying to open activity to capture image from camera. My manifest.xml file: <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/paths" /> </provider> My paths.xml file: <paths xmlns:android="http://schemas.android.com/apk/res/android">

help : how can i do “include(in xml)” programmatically in my app Android?

北战南征 提交于 2019-12-04 19:29:53
i have in my layout.xml this lines : <include android:id="@+id/promo1" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/one_promo"> </include> <include android:id="@+id/promo2" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/one_promo"> </include> <include android:id="@+id/promo3" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/one_promo"> </include> I want to do this programmatically in my Java code. Please any help? thanks in advance Use LayoutInflater as i shown below Define a