android-layout

change position of spinner dropdown list

北城余情 提交于 2021-01-26 23:48:28
问题 I need to change the horisontal position of Spinner's dropdown list. here's the screenshot : and I want this dropdown list to go in one line under the main icon/text so it would look fine As on the picture : here's what I do in xml : <Spinner android:id="@+id/tvHeader" style="@style/spinner_style" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/ver_main_donate_background_tile_long" android:layout_alignTop="@+id/ver_main_donate

Android XML Is there a way to use the tool namespace with custom attributes?

自闭症网瘾萝莉.ら 提交于 2021-01-26 03:13:09
问题 I've created a custom view with attributes. Is there a way to use those attributes with android tools in Android studio? for example : <MyOwnCoolView android:layout_width="96dp" android:layout_height="96dp" android:padding="3dp" tools:dividerAngle="2"/> Where the attr file is : <resources> <declare-styleable name="MyOwnCoolView"> <attr name="dividerAngle" format="float"/> </declare-styleable> 回答1: My opinion is that you can't. There's an official, though very old, page here that quotes:

How to add padding before CheckBox/RadioButton across API levels

允我心安 提交于 2021-01-24 14:05:03
问题 I want to add padding to the left/start of RadioButton and CheckBox views. The motivation for this is to have full width selectable lists (for select one and select multiple) where the radio button or check box element have space between themselves and the screen edge but also don't end up with a non clickable area where that space is. For API 16 and below I can add the spacing AND maintain clickability I can use the view's paddingLeft attribute. For API 17 and above this attribute controls

How can I change the color of my text based on the color of the ImageView it overlays?

偶尔善良 提交于 2021-01-21 05:04:51
问题 So I've got transparant buttons with white text labels set up over a user uploaded ImageView . If the user uploads an image that is mostly white, then the buttons are hard to see if not completely invisible. Does anyone know of a way to get the average color of a ImageView 's source picture/drawable? If I can do this, I can compare it to a certain threshold I can trial and error for... If I can get this, then I can change the color of the text on my buttons to the inverted version of this

How to change the color of a button?

删除回忆录丶 提交于 2021-01-20 16:22:17
问题 I'm new to android programming. How do I change the color of a button? <Button android:id="@+id/btn" android:layout_width="55dp" android:layout_height="50dp" android:layout_gravity="center" android:text="Button Text" android:paddingBottom="20dp"/> 回答1: You can change the colour two ways; through XML or through coding. I would recommend XML since it's easier to follow for beginners. XML: <Button android:background="@android:color/white" android:textColor="@android:color/black" /> You can also

How to change the color of a button?

江枫思渺然 提交于 2021-01-20 16:19:45
问题 I'm new to android programming. How do I change the color of a button? <Button android:id="@+id/btn" android:layout_width="55dp" android:layout_height="50dp" android:layout_gravity="center" android:text="Button Text" android:paddingBottom="20dp"/> 回答1: You can change the colour two ways; through XML or through coding. I would recommend XML since it's easier to follow for beginners. XML: <Button android:background="@android:color/white" android:textColor="@android:color/black" /> You can also

How to change the color of a button?

情到浓时终转凉″ 提交于 2021-01-20 16:19:09
问题 I'm new to android programming. How do I change the color of a button? <Button android:id="@+id/btn" android:layout_width="55dp" android:layout_height="50dp" android:layout_gravity="center" android:text="Button Text" android:paddingBottom="20dp"/> 回答1: You can change the colour two ways; through XML or through coding. I would recommend XML since it's easier to follow for beginners. XML: <Button android:background="@android:color/white" android:textColor="@android:color/black" /> You can also

I the error “unexpected element <queries> found in <manifest>”, how to fix it? [closed]

為{幸葍}努か 提交于 2021-01-20 07:10:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 28 days ago . Improve this question this is the screenshot play-services-ads-lite-19.6.0/AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest> . This is the error. 回答1: I also had same issue on Android Studio 4.1.1, suddenly, 2 days ago. I solved the issue by upgrading

making a calculator app and want to update history in second fragment with SharePreferences but second Fragment is not updating

左心房为你撑大大i 提交于 2021-01-07 01:26:35
问题 I am making a calculator app and want to update history in second fragment but not able to find a perfect solution for updating ListView in second fragment. I tried many solutions but none of them worked properly. I'm using ViewPager to swipe between calculator and history fragments . I tired bundle class but if I use bundle in OnCreat method of first Fragment(CalculatorFragment) with ViewPager it shows me blank screen after starting an App & if I use Bundle class in Equal Button it crashes

Android : TabLayout not responding to clicks

妖精的绣舞 提交于 2021-01-06 05:57:13
问题 I have just created a layout that has a DrawerLayout and inside this there is the toolbar, tablayout and viewpager. However the in the tablayout, the tabs are not responding on clicking on them, but is changing on swiping. Here is the code: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer" android:layout_width="match