android-layout

How do I know the ID's of views if I am inflating a view multiple times in the same parent on button click?

為{幸葍}努か 提交于 2020-01-26 01:47:49
问题 I have a difficult situation, let me put it this way, I want the user to use my 3 text-fields to set data for alarm and after filling in the information, I give him an option to set another alarm for this purpose I use a button. I have three table rows in a table layout which are defined in a child.xml file and every element has an Id set. In my activity, I inflate child.xml multiple times on button click event and I am able to successfully inflate it as many times as I want. But my problem

save the state of button in android

六眼飞鱼酱① 提交于 2020-01-26 01:14:44
问题 am working on camera application i have two imageview one is auto and second is pro i want when i click on auto auto is selected and image icon changes and when i click on pro automatically auto view deselected and pro view is selected autobtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { autobtn.setImageResource(R.drawable.autoactive); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ModeActivity.this);

Use scrollView between two Linear Layout inside a LinearLayout

落花浮王杯 提交于 2020-01-26 00:28:49
问题 i want to put two scroll view on two layouts that are in inside a main layout .Here is my XML file Please help me on this <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/flightResultData" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:gravity="center_horizontal" android:orientation="horizontal" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"

Use scrollView between two Linear Layout inside a LinearLayout

一世执手 提交于 2020-01-26 00:28:28
问题 i want to put two scroll view on two layouts that are in inside a main layout .Here is my XML file Please help me on this <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/flightResultData" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:gravity="center_horizontal" android:orientation="horizontal" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"

get the height of layout which has wrap_content property

老子叫甜甜 提交于 2020-01-25 23:45:06
问题 I have a simple table and a scrollView for scrolling the TableRow . I had also added footer the problem is that i need to know what is the size of footer so I can give the android:layout_marginBottom="<size of footerbar> to my scrollView. So how can i get the height of the layout of footer bar? please help me. this is my footerbar code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android

How to achieve equal layout_width and layout_height

一个人想着一个人 提交于 2020-01-25 20:58:06
问题 What I am trying to achieve is to put 4 buttons next to each other, with some margins, and make them square (without supplying fixed sizes) I basically have a wrapper LinearLayout that holds 4 buttons, which I want them to be square shaped. <LinearLayout android:id="@+id/photos_photoWrapper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orienation="vertical"> <Button android:id="@+id/photos_photoButton1" android:layout

android.view.InflateException: Binary XML file line #8: Error inflating class fragment

守給你的承諾、 提交于 2020-01-25 20:31:21
问题 I am trying to make Google Map activity to find travel distance.But Unfortunately layout.xml file throw , below error and stop app. I used Min SDK version - 16. I tried lot of thing to do but still error is remain.I run my app in real device.Expect some expert help. 2218/? E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{scpp.globaleye.com.scppclient/scpp.globaleye.com.scppclient.ui.MapsActivity}: android.view.InflateException: Binary

android.view.InflateException: Binary XML file line #8: Error inflating class fragment

爱⌒轻易说出口 提交于 2020-01-25 20:31:12
问题 I am trying to make Google Map activity to find travel distance.But Unfortunately layout.xml file throw , below error and stop app. I used Min SDK version - 16. I tried lot of thing to do but still error is remain.I run my app in real device.Expect some expert help. 2218/? E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{scpp.globaleye.com.scppclient/scpp.globaleye.com.scppclient.ui.MapsActivity}: android.view.InflateException: Binary

Android Card UI : card resize (gabrielemariotti)

不想你离开。 提交于 2020-01-25 11:43:06
问题 I'm making an android app with cards UI, by using the library: https://github.com/gabrielemariotti/cardslib I want to make a custom card which will be smaller than the default card size. Is there any way to do this? 回答1: The default card has a min height. You can override this value in your dimens.xml: <dimen name="card_base_empty_height">96dp</dimen> 来源: https://stackoverflow.com/questions/25907697/android-card-ui-card-resize-gabrielemariotti

Inverted width and height when unlocking with device rotated

允我心安 提交于 2020-01-25 09:20:29
问题 I'm getting screen size using this code: getWindowManager().getDefaultDisplay().getRealSize(size); sw = size.x; sh = size.y; I'm using it for specifying DialogFragment width and height: @Override public void onResume() { super.onResume(); int sw = Util.getInstance().getScreenWidth(getActivity()); int sh = Util.getInstance().getScreenHeight(getActivity()); getDialog().getWindow().setLayout((int)(sw*0.6), (int)(sh*0.6)); } *I need to specify the width and height of the dialog in onResume. It's