android-xml

give equal space between ImageViews

故事扮演 提交于 2019-12-25 01:23:54
问题 i am trying to add some social images in my app about me screen but i am facing a problem of giving equal spaces between imageviews. my images looks like this: but i want to make them look like this: my code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/about_screen" > <LinearLayout android

Why does getScaleY() always returns 1.0? [Android]

倖福魔咒の 提交于 2019-12-25 01:13:51
问题 I have an ImageView that contains an image. This image is getting scaled to fit within the screen because it's too large. I'm trying to find out how much the image has scaled using getScaleY() and getScaleX() . This should return 1.0 if the image has not been scaled and return some value less than 1.0 if the image is scaled down to fit the view. Instead, getScaleX() and getScaleY() alsways return 1.0 for me whether the image is scaled down or not. You can see my XML here: <?xml version="1.0"

android how to make some space between buttons and make white line above each of them

守給你的承諾、 提交于 2019-12-24 16:35:27
问题 I have two buttons with xml background , i want to keep some space between them, because that are past exactly on each other , also i want to put white line above them , i will give you how i tried but it doesn't work with me <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="25dip" android:orientation="horizontal" android:weightSum="2" > <Button android:background="@drawable/button_selector" android:layout_width="fill_parent"

Error inflating navigation view from support library

a 夏天 提交于 2019-12-24 15:03:08
问题 I was just trying out the new support library navigation drawer. I read a tutorial and implemented the code as they said. I'm getting this error: Process: myapp.application, PID: 29645 java.lang.RuntimeException: Unable to start activity ComponentInfo{myapp.application/myapp.application.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class android.support.design.widget.NavigationView at android.app.ActivityThread.performLaunchActivity(ActivityThread

How can I enclose some XML elements in a bounding box?

谁说我不能喝 提交于 2019-12-24 05:01:28
问题 I want to enclose the pair of checkboxes and the radio buttons here: ...in a rectangle or "bounding box" so that it look something like this: ...but less ugly, of course. How can I do that with the following XML as a starting point: <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:orientation="vertical" android:paddingLeft="@dimen/activity

How can I enclose some XML elements in a bounding box?

丶灬走出姿态 提交于 2019-12-24 05:01:09
问题 I want to enclose the pair of checkboxes and the radio buttons here: ...in a rectangle or "bounding box" so that it look something like this: ...but less ugly, of course. How can I do that with the following XML as a starting point: <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:orientation="vertical" android:paddingLeft="@dimen/activity

Populating Spinner with JSON

你说的曾经没有我的故事 提交于 2019-12-24 03:37:57
问题 I done a populating spinner with JSON.But I got a Error in ArrayList: WorldPopulation cannot be resolved. public class MainActivity extends Activity { JSONObject jsonobject; JSONArray jsonarray; ProgressDialog mProgressDialog; ArrayList<String> worldlist; ArrayList<WorldPopulation> world; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new DownloadJSON().execute(); } private class DownloadJSON extends

Change the background color of XYplot in android to white?

允我心安 提交于 2019-12-24 03:07:27
问题 This my XML file I want to change the background color of this XY plot in android to White? I tried some code but it's not changing. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/LinearLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"

Android Buttons not scaling

*爱你&永不变心* 提交于 2019-12-24 00:57:21
问题 This seems like a very basic question but I can't seem to figure it out. I have done quite a bit of reading on how to make android scalable to big and small screens. I have an app that is designed for a tablet and works great on there. However, while I am working on the mobile(phone) version I want to ensure it will at least look "ok" if someone opens it on a phone. Everyone scales great besides the buttons.... I just can't seem to get the buttons to scale. They look great on the Tab...but on

How to change the color of actionbar (actionbarsherlock)

末鹿安然 提交于 2019-12-24 00:33:45
问题 How to change the color of actionbar (actionbarsherlock) ? I've been tried below code but no luck. <style name="MyTheme.ActionBarStyle" parent="Widget.Sherlock.ActionBar"> <item name="background">#ffffffff</item> </style> <style name="Theme.SherlockCustom" parent="@style/Theme.Sherlock.Light"> <item name="actionBarStyle">@style/MyTheme.ActionBarStyle</item> </style> +and one thing more, i'm add submenu like below. this button's background color is also white(because Sherlock Theme). could i