android-layout

constraint layout - Two views with largest width

寵の児 提交于 2020-01-23 04:24:07
问题 I want to create a layout (using constraint layout) like the following: In different languages Button1 may be larger than button2. How can I do this? I've only been able to achieve this using a LinearLayout inside the constraint that contains the two buttons, but I'm trying to use only a layout. Thanks 回答1: I have seen questions akin to this one on Stack Overflow a number of times. These questions never have a satisfactory answer IMO (including ones that I have answered.) The difficulty is

How to remain the listView index selected and highlighted?

我们两清 提交于 2020-01-23 04:23:16
问题 In My app i have implement the ListView . Now i want it to set as like that: If i select on perticular index it should be remain as selected. ans appear as selected on ListView . If i select another index then now that new index should be remain as selected. Edited Means I want to set as the selected index should remain as highlighted as selected till I select another. but not like multiple selected. So how to do it ? Please help me for that. I have implemented the ListView as like below code

ImageView Center in position with ScaleType Matrix

人走茶凉 提交于 2020-01-23 03:17:10
问题 I am using Zoom effect with ImageView so I need to use scaletype=matrix. Now, I want to set Center position to ImageView but I am not able to set it. Please help me regarding this. layout.xml : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/imgImage" android:layout_width="fill_parent" android:layout_height="fill_parent"

How to dispaly result list into TableLayout row in android?

寵の児 提交于 2020-01-23 02:12:08
问题 I have a little bit problem that displaying list data to TextView in Android. My scenario is I have a TableLayout with Default One TableRow . Inside table row, I has been created new LinearLayout . Then, Four TextView created inside LinearLayout . I adding some default value to this textview. My default value is 1, 2014-02-05, S02, 20 Here my code snippet for above scenari0. <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/sync

how to make a rounded corners for an image in image view using XML layout in android

穿精又带淫゛_ 提交于 2020-01-23 02:07:06
问题 I have tried many times but i know that i am missing something,could you Guys please explain it.. Following is what, i have tried <ImageView android:id="@+id/Dicimage" android:layout_width="130px" android:layout_height="100px" android:src="@drawable/slang" android:background="@drawable/corner" android:padding="1dp"/> Created Corner XML in resource folder <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid

How to set background of collapsing toolbar with custom behavior to fit whole screen

孤者浪人 提交于 2020-01-22 20:09:27
问题 I'm following nice repo which shows how to make custom behavior of collapsing toolbar WhatsApp-ProfileCollapsingToolbar. What I don't like is when picture below toolbar (toolbar's font is white) is white then toolbar is not visible. So I'm trying to set background of toolbar to some color. First I added to widget_header_view.xml android:background="@android:color/holo_red_light" and now I have it like: <?xml version="1.0" encoding="utf-8"?> <com.anton46.whatsapp_profile.HeaderView xmlns

How to embed HTML code in Android app?

依然范特西╮ 提交于 2020-01-22 15:12:25
问题 I am writing an app for which I need to embed HTML object in the Android app, I followed the tutorial given here: http://mobile.tutsplus.com/tutorials/android/android-sdk-embed-a-webview-with-the-webkit-engine/ and modified the code accordingly, following is the code, but I am getting a white screen... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView engine = (WebView) findViewById(R.id.web_engine); engine.getSettings

After Android Studio Update Suddenly my Java & Xml file changed

为君一笑 提交于 2020-01-22 14:39:49
问题 Java File Show like below Before After Xml file show like below Before After I have tried clear Project, Rebuild Project, Restart/Invalidate, delete Build,.idea folders but its doesn't work. 回答1: I have tried below solution and its work for me. I have delete caches folder from C: Drive . C:\Users\admin\.AndroidStudio3.3\system\caches 来源: https://stackoverflow.com/questions/54823621/after-android-studio-update-suddenly-my-java-xml-file-changed

After Android Studio Update Suddenly my Java & Xml file changed

青春壹個敷衍的年華 提交于 2020-01-22 14:39:06
问题 Java File Show like below Before After Xml file show like below Before After I have tried clear Project, Rebuild Project, Restart/Invalidate, delete Build,.idea folders but its doesn't work. 回答1: I have tried below solution and its work for me. I have delete caches folder from C: Drive . C:\Users\admin\.AndroidStudio3.3\system\caches 来源: https://stackoverflow.com/questions/54823621/after-android-studio-update-suddenly-my-java-xml-file-changed

How to use Android GradientDrawable

人走茶凉 提交于 2020-01-22 13:08:10
问题 I try to use the GradientDrawable to set a gradient to some backgrounds and buttons. Sadly the documentation is not very detailed. What are the main attributes to configure the gradient? I understand start and endcolor but some of the other attributes could need some explanation. At the moment I used images as the background for the buttons but a drawable defined in XML would be much nicer. I try to get a look like this (It is a very light gradient): alt text http://janusz.de/~janusz