android-xml

re-setting a TextView height programmatically

痴心易碎 提交于 2019-12-18 11:06:03
问题 I want to reset a textView height after I have added it to the main window in the xml file. inside a RelativeLayout, <TextView android:id="@+id/text_l" android:layout_width="50sp" android:layout_height="50sp" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginLeft="10sp" android:layout_marginTop="145dp" android:gravity="center" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#000000" > </TextView> I just want to

How to map accented characters in keyboard xml

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 08:56:53
问题 I have to implement a simple custom soft-keyboard in my application and I want to show accented characters on the keyboard too. These are: í, é, á, ű, ú, ő, ó, ü, ö My question is how to map these in the keyboard xml? What are the key codes for these? I could not found them in the official KeyEvent document. My current keyboard definition xml looks like this: <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" android:horizontalGap="0px" android

Error inflating class android.support.v7.internal.widget.ActionBarView

為{幸葍}努か 提交于 2019-12-18 08:16:29
问题 My application was working but when I came to start working on it this morning everything is not working. I am getting an error inflating class error which seems to be from an xml file where I get the "Binary XML file line #25" line. As I said this was working fine and now all of a sudden it does not. Below is the exception trace: 01-27 11:20:53.624: E/AndroidRuntime(7831): FATAL EXCEPTION: main 01-27 11:20:53.624: E/AndroidRuntime(7831): java.lang.RuntimeException: Unable to start activity

Android menu line break

落花浮王杯 提交于 2019-12-18 07:09:12
问题 I have the following Android menu XML file: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/programma" android:icon="@android:drawable/ic_menu_agenda" android:title="@string/programma" /> <item android:id="@+id/settings" android:icon="@android:drawable/ic_menu_preferences" android:title="@string/settings" /> <item android:id="@+id/help" android:icon="@android:drawable/ic_menu_help" android:title="@string/help" />

Popup menu with icon on Android

强颜欢笑 提交于 2019-12-18 04:11:10
问题 My menu xml code menu.xml : <?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Single menu item Set id, icon and Title for each menu item --> <item android:id="@+id/back" android:icon="@drawable/back1" android:showAsAction="never" android:title="Back" /> <item android:id="@+id/My_Profile" android:icon="@drawable/myprofile" android:showAsAction="never" android:title="My Profile" /> <item android:id="@+id/Job_Alert" android:icon="

Android Studio: Rendering Problems Missing styles-correct theme chosen for this layout, Failed to find style with id

大城市里の小女人 提交于 2019-12-18 03:11:30
问题 I want to create card item xml layout for CardView and getting this error. Common solutions here not worked (tried them all and others from similar posts). This is my xml : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card

Unexpected auto-formatting of XML layout in Android Studio

帅比萌擦擦* 提交于 2019-12-17 22:49:14
问题 I am using AS since 4 years. After last update I observed unexpected auto-formatting of XML layout (while typing and with Code -> Reformat Code too). Here is an example: When I started typing relative layout, it expanded start tag, width property, height property and closing tag in the same line. Properties starts after indentation. No space between views after reformat. Question Is this a feature in new AS? then how can I revert it back? Did I change some setting? What setting should I

Toolbar in AppBarLayout is scrollable although RecyclerView has not enough content to scroll

a 夏天 提交于 2019-12-17 21:43:24
问题 Is it really intended that the Toolbar in a AppBarLayout is scrollable although the main container with the "appbar_scrolling_view_behavior" has not enough content to really scroll? What I have tested so far: When I use a NestedScrollView (with "wrap_content" attribute) as main container and a TextView as child, the AppBarLayout works properly and does not scroll. However, when I use a RecyclerView with only a few entries and the "wrap_content" attribute (so that there is no need to scroll),

Gradient Radius as percentage of screen size

回眸只為那壹抹淺笑 提交于 2019-12-17 18:01:15
问题 I'm trying to create a shape drawable with radial gradient background, with radius that will adjust to the screen size (take a look at the relevant documentation). This is my code: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:endColor="#000" android:gradientRadius="50%p" android:startColor="#5d2456" android:type="radial" /> </shape> But it doens't seem to work. if I remove the "%p", it

Android scrollview hiding top content in layout

北战南征 提交于 2019-12-17 16:18:11
问题 Im having a problem where the android scrollview starts hiding a pair of textviews I have at the top of my layout, I have found another person on this very site who had that problem and was able to get help unfortunately the person who helped them didnt actually say what fixes it, can anyone tell me what was the fix here? android scrollview hiding top content any help would be huge here is my xml code: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android