android-xml

Android HorizontalScrollView content Stretch

ぃ、小莉子 提交于 2019-12-11 03:23:57
问题 I have a HorizontalScrollView with some buttons, I am trying to stretch these buttons to fill the whole width of the HorizontalScrollView so that they can appear organized and equally spaced between each others. Here is the Image which I have. I want these 4 buttons to be stretched over the whole width! here is my code <HorizontalScrollView android:id="@+id/items_HorizontalBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignBottom="@+id/vf"

Android how to highlight drawable of selected action bar tab

依然范特西╮ 提交于 2019-12-11 03:22:40
问题 I am looking to add action bar tabs with icons. I have achieved the following. In this, how do I make the selected tab icon orange i.e. if the first tab is selected, the first icon is orange, while the others stay gray and so on. Thanks 回答1: Possible solution is. You must create an icon in white and orange and put it in your drawables folder and in the onCreate method of your currently tab add this here: //TabActivity.onCreate() TabHost tabHost = getTabHost(); TabHost.TabSpec spec; Intent

Make LinearLayout in FrameLayout opaque

半腔热情 提交于 2019-12-11 02:17:19
问题 I cannot find a way how to make linearLayout opaque. It's always transparent no matter what I do. The layout looks like this: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <LinearLayout android:orientation="vertical" android:id="@+id/error_panel" android:layout_width="match_parent" android:background="@color/gray_background_dark" android:layout_height="wrap_content"> <TextView android:id="@+id

Do externalized strings need to be in strings.xml?

半世苍凉 提交于 2019-12-11 01:58:38
问题 When I right-click on my project in Eclipse, and select "Externalize Strings" the wizard ends up putting the strings in a new "messges.properties" file; shouldn't it go in /res/values/strings.xml, or does it matter? 回答1: "Externalize Strings" is a standard functionality that is implemented in eclipse to work with java. If you want to extract Android string you should simply select the string, press ctrl+1 and in the appeared menu choose "Extract String" with the Android picture near this

How To display Parsed Xml data in to ListView in Android

孤街浪徒 提交于 2019-12-11 00:48:03
问题 I am learning How to parse xml document in Android.I have full source code of XML parsing but it Shows Output on Console.But i want to show result data in ListView i dont know how to display data into listview.Could you help me to solve this issue.i am giving full source code here. MainActivity.java public class MainActivity extends Activity { private ProgressDialog pDialog; private ItemXMLHandler myXMLHandler; private String rssFeed = "https://www.dropbox.com/s/t4o5wo6gdcnhgj8/imagelistview

MockView cannot be cast to android.view.ViewGroup in xml

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 22:03:54
问题 While checking in the graphical layout I am getting this error: Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup Below I am posted my activity_main.xml codes: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" >

Strange XML layout bug when targeting Android 4.3

℡╲_俬逩灬. 提交于 2019-12-10 21:27:08
问题 I'm experiencing a really peculiar bug with an XML layout file when building my application while targeting API level 18. It doesn't happen with API level 17. I'm running the application on Android 4.3 devices, and the bug persists on all three devices. Here's what it looks like: API 17 (correct): API 18 (incorrect): I'm using the StickyGridHeaders library, and the following is my getHeaderView() method: @Override public View getHeaderView(int position, View convertView, ViewGroup parent) {

LinearLayout leaving out too much white space. Why?

我是研究僧i 提交于 2019-12-10 20:34:00
问题 I am writing an Android app that helps little kids learn maths. It gives the user some questions and the user would answer them. If he/she answers all of them correctly, a prize would be given. Now I need to tell the user about this in the ResultsActivity . Here is how it looks like: <LinearLayout 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:paddingLeft

Android Error inflating class EditText

二次信任 提交于 2019-12-10 15:14:59
问题 I encountered a strange problem. My Android app would crash whenever I add an EditText in an Activity . To test, I open a new clean project, and the new project will crash if there is an EditText as well. Therefore, I think the problem is caused from Android Studio or other environment setting. Following is the activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res

Failed to create the part's controls

[亡魂溺海] 提交于 2019-12-10 14:39:53
问题 I get a null pointer exception opening about half of the android XML files in my layout directory. There seems to be no pattern to why some files open and some files don't. I upgraded eclipse to Juno. Re-installed all the plugins (ADT), re-installed the android SDK. I brought in my old workspace and adjusted my projects to point at the new android SDK. Stack java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite