android


How to make search widget larger in actionbar?


XML code here
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android">
<EditText android:id="#+id/find_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:contentDescription="#string/find_text"
android:background="#drawable/url_bar_entry"
android:singleLine="true"
android:textColor="#000000"
android:textCursorDrawable="#null"
android:inputType="text"
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:textColorHighlight="#color/url_bar_text_highlight"
android:imeOptions="actionSearch"
android:selectAllOnFocus="true"
android:gravity="center_vertical|left"/>
<ImageButton android:id="#+id/find_prev"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_prev"
android:src="#drawable/find_prev"/>
<ImageButton android:id="#+id/find_next"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_next"
android:src="#drawable/find_next"/>
<ImageButton android:id="#+id/find_close"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_close"
android:src="#drawable/find_close"/>
</RelativeLayout>
I am inflating this menu by using this:
LayoutInflater inflater = LayoutInflater.from(mContext);
View content = inflater.inflate(R.layout.find_in_page_content, null);
EditText tv = (EditText) content.findViewById(R.id.find_text);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
tv.setLayoutParams(params);
//CODE TO ADD TO only EditText view to menu object I have
The outcome of this is seen here: http://imgur.com/sQZ7Lbh
My question is:, how can I make the url bar take up as much space as availble in the actiobar rather than be restricted to a tiny square. I also want the cursor to show up when pressed but it doesn't. However, I think that this is fixed when I make the url bar longer.
Set this gravity attribute in XML in your RelativeLayout
android:layout_gravity="fill_horizontal"
Taken from http://stackoverflow.com/a/12884297/2158970

Related Links

Why Two Methods for FirebaseDatabase Client Offline?
In Android Studio, set android:text from strings.xml, but back to text later
Bring to front a view over foreground image of a frameLayout
Google Cloud Message Android Key
Android TextView linespacing
Clarification about ios and android push and ionic
error : couldn't read row 0 , col -1 from cursorWindow make sure the cursor is initialized correctly before accessing data from it?
Regd - Geting Bluetooth rssi value of Paired devices
Google Places Autocomplete not working after closing the application
enable click event on parallax ListView with sticky header in android
Get Lifelog API result
How to Know Current Install Location
How to set my circleImageView on the border of my layout in android?
How to make News Bar with Spannable Marquee TextView in Android?
CameraPreview Class does not fit the whole screen
Install CA Cert to “Wifi” instead of “VPN and apps”

Categories

HOME
beautifulsoup
time-complexity
codenvy
solver
can
grafana
ms-access-2016
cublas
limit
crystal-reports-2013
lanczos
modal-dialog
joomla3.0
teechart
pattern-matching
text-mining
opengl-es-3.0
speech-synthesis
gkturnbasedmatch
code-generation
android-intent
esoteric-languages
feathersjs
sigma.js
spring-async
pchart
jboss6.x
game-theory
data.stackexchange.com
fat
fragment-backstack
inversion-of-control
sinch
calculation
custom-controls
database-comparison
gojs
pop3
modalviewcontroller
least-squares
ogc
trigonometry
softmax
glm-math
apollostack
importerror
apache-directory
stylecop
optimizely
openresty
openal
builder
globalize
geotiff
tinymce-3
azure-cli
payload
py2neo
bootstrap-tags-input
atlas
resourcemanager
jboss-tools
cfchart
php-socket
sciruby
morton-number
wso2greg
linked-tables
keyup
typeconverter
nsurlsessiondatatask
matlab-deployment
nodelist
sonarqube-5.0
deform
teaspoon
trdion2011
ss7
codeplex
jjaql
qscrollarea
getopt
breakout
code-duplication
modular
unit-of-work
nebula
poker
facebook-timeline
traceability
swfobject
qi4j
subproject
jdb
database-create
creole
quotation-marks
uideviceorientation
web-garden
scrollbars
cfwindow
glui
fdf

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App